Newton's Preposterous Miscalculation
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

github-archive-stream

3.0.0 • Public • Published

github-archive-stream

Streams a .tar.gz (or .zip) archive from GitHub using the archive link api. It makes two http requests since the first is always a 30x redirect response.

npm Node version build status JavaScript Style Guide

Install

$ npm i github-archive-stream -S

Usage

Stream latest master branch of ipfs/go-ipfs to the file 'ipfs.tar.gz'.

const archive = require('github-archive-stream')
archive('ipfs/go-ipfs').pipe(require('fs').createWriteStream('ipfs.tar.gz'))

API

const stream = archive(repo|opts)

Create an archive stream.

Parameter can either be a string or an object. Use the string version to stream an open source archive. For private repositories you need to provide the opts.auth property, see below.

Options takes the following properties:

{
  repo: 'user/repo',      // github repository, required
  auth: {
    user: 'username',     // github user, required if private repo
    token: 'agithubtoken' // github token, required if private repo
  },
  ref: '315ae99',         // git ref, defaults to 'master'
  format: 'zipball'       // archive format, defaults to 'tarball'
}

License

MIT

install

npm i github-archive-stream

Downloadsweekly downloads

1

version

3.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability