bin/installer.js
function (urlPath, outStream, callback) {
  needle.get(`https://github.com${urlPath}`, {
    follow_max: 5,
    headers: { 'User-Agent': 'nodejs-client' }
  }, (error, response) => {
    if (error) {
      return callback(error)
    }
    outStream.write(response.body)
    outStream.end()
    if (process.env.VERBOSE) {
      process.stdout.clearLine()
      process.stdout.cursorTo(0)
      process.stdout.write('Download complete' + '\n')
    }
    return callback()
  })
}
function (urlPath, outStream, callback) {
  needle.get(`https://github.com${urlPath}`, {
    follow_max: 5,
    headers: { 'User-Agent': 'nodejs-client' }
  }, (error, response) => {
    if (error) {
      return callback(error)
    }
    outStream.write(response.body)
    outStream.end()
    if (process.env.VERBOSE) {
      process.stdout.clearLine()
      process.stdout.cursorTo(0)
      process.stdout.write('Download complete' + '\n')
    }
    return callback()
  })
}
function ( urlPath , outStream , callback ) { needle . get ( ` ${ urlPath } ` , { follow_max : 5 , headers : { 'User-Agent' : 'nodejs-client' } } , ( error , response ) => { if ( error ) { return callback ( error ) } outStream . write ( response . body ) outStream . end ( ) if ( process . env . VERBOSE ) { process . stdout . clearLine ( ) process . stdout . cursorTo ( 0 ) process . stdout . write ( 'Download complete' + '\n' ) } return callback ( ) } ) }
Downloads an archive usually zip or tar.gz from a URL which comes from the GitHub
release API.

@param  {String}   urlPath URL where to download the archive
@param  {Stream}   writeable output stream to save the archive
@param  {Function} callback Callback (err)
@return {void}
Downloads an archive usually zip or tar . gz from a URL which comes from the GitHub release API .