https://github.com/131/npm-mirror
https://github.com/131/npm-mirror
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/131/npm-mirror
- Owner: 131
- License: mit
- Created: 2021-03-04T17:48:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-08T11:03:00.000Z (about 1 year ago)
- Last Synced: 2025-04-10T12:37:37.083Z (about 1 year ago)
- Language: JavaScript
- Size: 60.5 KB
- Stars: 9
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/131/npm-mirror/actions/workflows/test.yml)
[](https://coveralls.io/github/131/npm-mirror?branch=master)
[](https://www.npmjs.com/package/npm-registry-mirror)
[](http://opensource.org/licenses/MIT)
[](https://www.npmjs.com/package/eslint-plugin-ivs)
# Motivation
npm-registry-mirror is a utility for mirroring a subset of npm packages from another npm registry. It syncs recursively all the required dependencies and writes them to the local filesystem so that a simple webserver can behave like a read-only registry.
This module was designed a a drop-in replacement for the no longer maintened "npm-mirror" module.
# Usage
```
npm install -g npm-registry-mirror
# Put some packages.json (e.g. rename & timestamp them) in /some/path/to/manifests/
npm-mirror \
--registry_url=http://myserver.com/npm/ \
--manifest_directory=/some/path/to/manifests/ \
--package_directory=/path/to/local/cache/ \
```
## Http server
```
export DEBUG=*,-send,-express:*
cnyks . [config_path] --ir://start
# force curl no buffer
curl -X POST http://127.0.0.1:8080/process
cat /mnt/r/package.json | curl -X PUT --data-binary @- http://127.0.0.1:8080/feed
```
# Tests & dependencies
npm-mirror relies on a very few but powerfull modules, with 100% coverage & test.
All good friend of mine.
# Credits
* [131](https://github.com/131)
* [mozilla-b2g/npm-mirror](https://github.com/mozilla-b2g/npm-mirror)
# Keywords / shout box
npm, npm-mirror, registry-mirror, registry, async, "Let's have a beer and talk in Paris"