https://github.com/roppa/npm-downloader
Download a list of modules
https://github.com/roppa/npm-downloader
Last synced: about 1 year ago
JSON representation
Download a list of modules
- Host: GitHub
- URL: https://github.com/roppa/npm-downloader
- Owner: roppa
- Created: 2016-11-17T16:27:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-25T15:15:10.000Z (over 9 years ago)
- Last Synced: 2025-03-15T06:35:47.844Z (over 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NPM module downloader
[](https://travis-ci.org/roppa/npm-downloader)
Download a list of npm modules to use offline. My use case was for use on a server that has no outside connection so need to import modules into artifactory. The list can either be the url to the tarball (.tgz), the name, or the name@version of the module.
For example, to get a list of modules used in your app run:
```
npm ls --json > packages.json
```
Then traverse your JSON object and create an array of modules.
## Running
The function takes 2 parameters, the target download directory and the array of modules to download:
```
let dn = require('.');
dn('./downloads', ['wordify', 'elasticsearch-synonyms']);
```
A Promise is returned, which when fulfilled will return an object:
```
{
success: [],
errors: [],
}
```
## Test
```
npm run test
```
## References
- [Npm documentation](https://docs.npmjs.com/)