@etclabscore/dl-github-releases
A node module to download Github assets for Github releases. It will also uncompress zip files.
Last updated 2 months ago by belfordz .
Apache 2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @etclabscore/dl-github-releases 
SYNC missed versions from official npm registry.

DL Github Releases

A node module to download Github assets for Github releases. It will also uncompress zip files.

Command line

$ npm install -g @etclabscore/dl-github-releases


$ dl-github-releases --help

Usage: download-github-releases [options] <user> <repo>

Options:
  -V, --version                      output the version number
  -o, --outputDir [output]           output directory [output] (default: "/Users/zb/Code/etclabs/dl-github-releases")
  -p, --includePre                   download prerelease
  -d, --includeDraft                 download draft releases
  -a, --filterAssetsByName <rexexp>  filter assets name
  -z, --zipped                       don't extract zip files
  -h, --help                         output usage information
Usage: download-github-release [options] <user> <repo> [outputdir]

Options:

  -h, --help             output usage information
  -V, --version          output the version number
  -p, --prerelease       download prerelease
  -s, --search <regexp>  filter assets name


$ dl-github-releases -a *.md open-rpc spec

Downloading open-rpc/spec@1.0.0...
spec.md                  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 0.0s
spec.pdf                 ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇--------- 0.1s

Javascript API

Installation

npm install --save dl-github-releases

Usage

var downloadReleases = require('dl-github-releases');

var user = 'some user';
var repo = 'some repo';
var outputdir = 'some output directory';

// Define a function to filter releases.
function filterRelease(release) {
  // Filter out prereleases.
  return release.prerelease === false;
}

// Define a function to filter assets.
function filterAsset(asset) {
  // Select assets that contain the string 'windows'.
  return asset.name.indexOf('windows') >= 0;
}

downloadReleases(user, repo, outputdir, filterRelease, filterAsset)
  .then(function() {
    console.log('All done!');
  })
  .catch(function(err) {
    console.error(err.message);
  });

Current Tags

  • 1.1.2                                ...           latest (2 months ago)

9 Versions

  • 1.1.2                                ...           2 months ago
  • 1.1.1                                ...           2 months ago
  • 1.1.0                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 9
Dependencies (4)
Dev Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |