Forked version which prereserve /-/
in files path, so it can be easily used with existing package-lock.json file for offline install.
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
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