NodeJS binaries + npm, hosted over IPFS
A small utility in two parts. One is to clone existing NodeJS binaries and host them over IPFS. The other one is to set your
n client to download new NodeJS binaries over IPFS
A script that helps you to fetch and mirror NodeJS binaries from nodejs.org/dist with IFPS.
When you download a new node version, you want it to be fast right? And there is no faster way to download something than through local network (if it exists there) and if needed, falls back to fetching the binary from the closest mirror.
IPFS helps with this. Basically you have two commands, probably only one you really care about (the
npm install -g node-ipfs-mirror
Clone and host binaries that fits with your version requirements (version 0.12 and up by default):
If you run the command before and run it again, it updates the binaries to the latest versions, leaving already downloaded versions
Run a built-in IPFS daemon for hosting the binaries. Adds binaries to IPFS and then starts an IPFS daemon
node-ipfs-mirror env nvm<- Prints command for setting the environment variable for usage with
node-ipfs-mirror env n<- Prints command for setting the environment variable for usage with
For extra style points, run
eval $(node-ipfs-mirror env nvm) and you'll be up and running in no time! 🍪