prepare-nodedep-tar
v3.12.0
Published
Downloads all of the node_modules based on a package-lock.json file
Downloads
5
Maintainers
Readme
prepare-nodedep-tar (node-tgz-downloader)
Forked version which prereserve /-/
in files path, so it can be easily used with existing package-lock.json file for offline install.
Example:
sed -i -e 's~\(resolved": "\)[^\/]*\/~\1file:..\/..\/opennebula-fireedge-modules-6.0.3.1~' package-lock.json
it changes source from
- from:
https://registry.npmjs.org/semver/-/semver-5.7.1.tgz
- to:
file:../../opennebula-fireedge-modules-6.0.3.1/registry.npmjs.org/semver/-/semver-5.7.1.tgz
and you can use this tool to prepare offline files with correct filesystem structure
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
install
npm install node-tgz-downloader -g
usage
From Code:
const downloader = require('node-tgz-downloader');
downloader.downloadFromPackageLock('path/to/package-lock');
From Command Line:
package-lock.json
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
package name
download-tgz package @angular/cli --devDependencies --peerDependencies
package.json
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
search keyword
downloads the packages returned from an npm search query (https://registry.npmjs.org/-/v1/search?)
download-tgz search tgz