node-reggie
node-reggie copied to clipboard
Import packages from registry.npmjs.org
I want to maintain a "snapshot" of packages I use for my products, as well as its dependencies. Is it possible ?
Hi @sonoman, thank you for reporting the issue. See my comment in #9 for instructions on how to manually download packages from npmjs.org and store them in Reggie.
Since this requirement is recurring, I'll keep this issue open to serve as a reminded of a missing feature. My vision is to add a new command to the Reggie client that will do the snapshot in an automated way:
$ reggie mirror semver
$ reggie mirror semver@latest
$ reggie mirror [email protected]
Having said that, I won't have bandwidth to implement this feature any time soon. I am happy to provide help and guidance if you (or anybody else) decide to contribute the implementation.
there's a tool called npm-mirror that uses the same package.json format to specify which packages do you want to synchronize.....you could specify reggie mirror ./package.json
I may be interested in taking this on.
How I'm seeing this working:
1. Download packages from npmjs.org into a local cache dir.
a. If it is `reggie mirror semver`, it gets all versions, if a version is provided, then only that version.
2. Calls npm install --registry=reggie_url on the downloaded packages
@bajtos Were you thinking of running this as a one-time event or as a job that frequently checks?
@paolodm Great!
Calls npm install --registry=reggie_url on the downloaded packages
I would prefer a solution that does not invoke npm. Dependencies should be (recursively) extracted from package.json or even directly from the data returned by npmjs.org. See how npm-mirror is doing this.
It would be super nice to extract the discovery of dependencies into a standalone module that can be used & shared by multiple projects - reggie, npm-mirror, even npm client itself.
Were you thinking of running this as a one-time event or as a job that frequently checks?
As an one-time event to keep reggie small and focused. There are already solutions for running a job periodically (e.g. cron or Windows Scheduler), there is no need to reinvent the wheel.