Package Exports
- sinopia-freeze-storage
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sinopia-freeze-storage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
sinopia-freeze-storage
Makes your sinopia/verdaccio registry actually work when going offline. This tool updates sinopia's package.json storage files to
describe only locally available packages.
You might like verdaccio-offline-storage, which is a Verdaccio plugin that does what this tool does but without modifying the storage content (everything is done on the fly on demand).
Usage
Install the module:
npm install --global sinopia-freeze-storagethen use the cli:
freeze-storage /path/to/sinopia/storage/directoryWhy?
tl;dr:
If my registry worked when online, then it must work later when offline for the same dependencies requirements.
Long version (basically me complaining about not having internet access everywhere):
I run a sinopia-like repository at work with internet connection. There I npm install all my required dependencies, meaning
all required modules gets stored in the sinopia storage. More than that, this means sinopia will download the exact module versions
I need for the project I'm working on. The problem starts when going offline some time later and try to npm install from scratch
(e.g no yarn.lock file): sinopia says it can't find the package I'm requesting, and this mostly happens because a newer version of
some module has been released, and it's latest version isn't the one I locally have. Ok fine, I know my package.json is asking for
some-package@^4.1.0 and there is some-package@4.1.1 available, so the newer should be installed instead, but damn I just want the one
I currently have at least! Also, I don't want to force my package dependencies to match an exact version, and I can't force that for
my dependencies dependencies anyway.
Using as a module
const freeze = require('sinopia-freeze-storage');
freeze('/path/to/storage/dir');