Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including registry-mirror with all npm packages installed. Try it out:

var registryMirror = require("registry-mirror")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

registry-mirror v0.6.3

Set up a NPM registry mirror, using your favourite storage, IPFS! :D


Dependency Status js-standard-style

registry-mirror sets a mirror the the whole NPM registry, using IPFS for the discovery and transport of modules.


Quick setup (probably all that you need)

Install IPFS dev0.4.0

To install IPFS dev0.4.0, you will need go installed, to install go in your machine, go to and then run:

$ go get -u
$ ipfs version
ipfs version 0.4.0-dev

Run IPFS daemon

$ ipfs daemon
Initializing daemon...
Swarm listening on /ip4/
Swarm listening on /ip4/
Swarm listening on /ip4/
Swarm listening on /ip6/2001:8a0:7ac5:4201:4816:fd56:bea7:eaf3/tcp/4001
Swarm listening on /ip6/2001:8a0:7ac5:4201:ae87:a3ff:fe19:def1/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/
Gateway (readonly) server listening on /ip4/
Daemon is ready

Install registry-mirror

$ npm i registry-mirror -g


Wait for the Updated directory listing log.

$ registry-mirror daemon
registry-mirror [info] using output directory /npm-registry/
registry-mirror [info] listening on
registry-mirror [info] Cloning NPM OFF
registry-mirror [info] Updated directory listing, good to go :)

Port 50321 is default and can be set with --port.

Configure npm

Set up your npm to use registry-mirror with the default port through:

$ npm config set registry http://localhost:50321

If you picked another --port you need to adjust accordingly.

Good to npm install away! :)



$ registry-mirror
Usage: registry-mirror COMMAND [OPTIONS]

Available commands:

daemon       Mirror npm registry
ls           Check modules available in the mirror
npm publish  Publish an IPNS record with your current npm list
npm update   Update your npm list of modules from IPNS



starts the registry-mirror daemon

$ registry-mirror daemon


  • --clone - Download the entire npm (Otherwise it just tries to read)
  • --port=<port> Listen on the specified port
  • --host=<host> Listen on the specified port


lists all the modules available on the IPFS accessible registry and their respective hashes

$ registry-mirror ls

npm update

update your local registry cache

$ registry npm update

npm publish

publish the version of the cache you have from npm

$ registry npm publish


If you are on Mac OS X, make sure to increase the limit of files open (with ulimit -Sn 4096), otherwise the ipfs daemon will be sad and throw 502 replies.


This module takes a lot of inspiration from reginabox. Big thank you to everyone that contributed with code or to the discussion to make this happen.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free