{"id":15681712,"url":"https://github.com/jonschlinkert/get-file","last_synced_at":"2025-05-07T12:42:50.822Z","repository":{"id":26885753,"uuid":"30346589","full_name":"jonschlinkert/get-file","owner":"jonschlinkert","description":"CLI and API to get a single file from Github repository.","archived":false,"fork":false,"pushed_at":"2017-05-31T21:04:49.000Z","size":24,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-26T15:03:09.410Z","etag":null,"topics":["api","cli","content","file","github","repo"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"repoze/repoze.debug","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-05T09:01:10.000Z","updated_at":"2025-01-10T17:09:40.000Z","dependencies_parsed_at":"2022-08-07T12:01:13.761Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/get-file","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fget-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fget-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fget-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fget-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/get-file/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252879970,"owners_count":21818896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cli","content","file","github","repo"],"created_at":"2024-10-03T16:58:58.361Z","updated_at":"2025-05-07T12:42:50.801Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-file [![NPM version](https://img.shields.io/npm/v/get-file.svg?style=flat)](https://www.npmjs.com/package/get-file) [![NPM monthly downloads](https://img.shields.io/npm/dm/get-file.svg?style=flat)](https://npmjs.org/package/get-file) [![NPM total downloads](https://img.shields.io/npm/dt/get-file.svg?style=flat)](https://npmjs.org/package/get-file) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/get-file.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/get-file)\n\n\u003e CLI to get a single file from Github repository.\n\n## CLI\n\n### CLI installation\n\nInstall globally with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm install --global get-file\n```\n\n### CLI usage\n\nSpecify the repo and filename:\n\n```bash\nget-file assemble/assemble README.md\n```\n\n**List files**\n\nSee a list of files for a repo before downloading one:\n\n```bash\nget-file --list assemble/assemble\n```\n\n## API\n\n### API installation\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install get-file\n```\n\n## API usage\n\n### [get](index.js#L22)\n\nGet an individual file and return a stream in the callback.\n\n**Params**\n\n* `repo` **{String}**: Repository to get file from.\n* `filename` **{String}**: file to get.\n* `cb` **{Function}**: Callback function that takes `err` and `res` arguments.\n\n**Example**\n\n```js\nvar get = require('get-file');\nget('jonschlinkert/get-file', 'package.json', function(err, res) {\n  if (err) return console.error(err);\n  var file = fs.createWriteStream('package.json');\n  res.pipe(file);\n});\n```\n\n### [.files](index.js#L49)\n\nList the files in a given repository.\n\n**Params**\n\n* `repo` **{String}**: Repository to get list of files.\n* `cb` **{Function}**: Function that takes `err` and `files` arguments\n\n**Example**\n\n```js\nvar get = require('get-file');\nget.files('jonschlinkert/get-file', function(err, files) {\n  if (err) return console.error(err);\n  console.log(files);\n});\n```\n\n## Release history\n\n### v1.0.0 - MAJOR BREAKING CHANGES\n\n* the main export is now a function\n* `.listFiles` was renamed to `.files`\n\n## About\n\n### Related projects\n\n* [gists](https://www.npmjs.com/package/gists): Methods for working with the GitHub Gist API. Node.js/JavaScript | [homepage](https://github.com/jonschlinkert/gists \"Methods for working with the GitHub Gist API. Node.js/JavaScript\")\n* [github-base](https://www.npmjs.com/package/github-base): JavaScript wrapper that greatly simplifies working with GitHub's API. | [homepage](https://github.com/jonschlinkert/github-base \"JavaScript wrapper that greatly simplifies working with GitHub's API.\")\n* [github-contributors](https://www.npmjs.com/package/github-contributors): Generate a markdown or JSON list of contributors for a project using the GitHub API. | [homepage](https://github.com/jonschlinkert/github-contributors \"Generate a markdown or JSON list of contributors for a project using the GitHub API.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 31, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fget-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fget-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fget-file/lists"}