0.1.0 • Published 3 years ago
github-partials v0.1.0
github-partials
Download any subdirectory of a GitHub repository
Installation
npm install github-partials
Usage
const githubPartials = require('github-partials')
// cwd is ~/mydevspace/
githubPartials('https://github.com/some-org-or-user/some-project/some/other/project/folder')
// copied remote content to ~/mydevspace/folder
githubPartials('https://github.com/some-org-or-user/some-project/README.md')
// copied remote content to ~/mydevspace/README.md
Also works as a CLI tool
# cwd is ~/mydevspace/
npx github-partials https://github.some-org-or-user/some-project/some/other/project/folder
# copied remote content to ~/mydevspace/some-project
npx github-partials https://github.some-org-or-user/some-project/README.md
# copied remote content to ~/mydevspace/README.md
API
githubPartials(url, outputDir?)
url
Type: string
The URL to the path you want to download. If a folder, will download its content as well.
outputDir
Type: string
Custom path to the outputDir (defaults to the working directorya)
License
MIT (c) Cezar Augusto.
0.1.0
3 years ago