Downloads all of the tarballs based on one of the following:
- local
package-lock.json
file - url to a
package-lock.json
- name of package
- local
package.json
file - url to a
package.json
- search keyword
npm install node-tgz-downloader -g
const downloader = require('node-tgz-downloader');
downloader.downloadFromPackageLock('path/to/package-lock');
from local file:
download-tgz package-lock path/to/package-lock.json
from url:
download-tgz package-lock https://raw.githubusercontent.com/Meir017/node-tgz-downloader/master/package-lock.json
download-tgz package @angular/cli --devDependencies --peerDependencies
from local file:
download-tgz package-json path/to/package.json
from url:
download-tgz package-json https://raw.githubusercontent.com/Meir017/node-tgz-downloader/master/package.json
downloads the packages returned from an npm search query (https://registry.npmjs.org/-/v1/search?)
download-tgz search tgz
The tool supports the https_proxy environment variable. Do not forget to specify protocol and port.
export https_proxy='https://proxy_url:port'