🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

get-file

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-file

CLI to get a single file from Github repository.

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
3
-57.14%
Maintainers
2
Weekly downloads
 
Created
Source

get-file NPM version

CLI to get a single file from Github repository.

CLI Usage

Install globally with npm

$ npm i -g get-file

Specify the repo and filename:

get-file assemble/assemble README.md

List files

To see a list of files for a repo before downloading one:

get-file assemble/assemble --list

API Usage

$ npm i get-file --save-dev
var client = require('get-file');

Params

  • repo {String}: Repository to get list of files.
  • cb {Function}: Function that takes err and files arguments

Example

client.listFiles('jonschlinkert/get-file', function (err, files) {
  if (err) return console.error(err);
  console.log(files);
});

Params

  • repo {String}: Repository to get file from.
  • filename {String}: file to get.
  • cb {Function}: Callback function that takes err and res arguments.

Example

client.getFile('jonschlinkert/get-file', 'package.json', function (err, res) {
  if (err) return console.error(err);
  var file = fs.createWriteStream('package.json');
  res.pipe(file);
});

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.

This file was generated by verb-cli on October 01, 2015.

Keywords

download

FAQs

Package last updated on 01 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts