{"id":13451900,"url":"https://github.com/ipfs-shipyard/npm-on-ipfs","last_synced_at":"2025-04-07T18:11:35.166Z","repository":{"id":57276574,"uuid":"46182325","full_name":"ipfs-shipyard/npm-on-ipfs","owner":"ipfs-shipyard","description":":package: Install npm modules through IPFS! ","archived":false,"fork":false,"pushed_at":"2022-04-11T17:42:28.000Z","size":78805,"stargazers_count":467,"open_issues_count":26,"forks_count":40,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-31T17:15:53.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipfs-shipyard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-14T16:34:30.000Z","updated_at":"2025-03-04T12:49:23.000Z","dependencies_parsed_at":"2022-09-19T03:51:49.491Z","dependency_job_id":null,"html_url":"https://github.com/ipfs-shipyard/npm-on-ipfs","commit_stats":null,"previous_names":["diasdavid/registry-mirror"],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-shipyard%2Fnpm-on-ipfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-shipyard%2Fnpm-on-ipfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-shipyard%2Fnpm-on-ipfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-shipyard%2Fnpm-on-ipfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipfs-shipyard","download_url":"https://codeload.github.com/ipfs-shipyard/npm-on-ipfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704571,"owners_count":20982298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T07:01:06.295Z","updated_at":"2025-04-07T18:11:35.112Z","avatar_url":"https://github.com/ipfs-shipyard.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/ipfs-shipyard/npm-on-ipfs/raw/master/img/npm-on-ipfs.jpg\" alt=\"npm distributed on top of lots of connected IPFS nodes worldwide\" /\u003e\n\u003c/p\u003e\n\n# npm-on-IPFS\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai)\n[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![Build Status](https://flat.badgen.net/travis/ipfs-shipyard/npm-on-ipfs)](https://travis-ci.com/ipfs-shipyard/npm-on-ipfs)\n[![Code Coverage](https://codecov.io/gh/ipfs-shipyard/npm-on-ipfs/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs-shipyard/npm-on-ipfs)\n[![Dependency Status](https://david-dm.org/ipfs-shipyard/npm-on-ipfs.svg?style=flat-square)](https://david-dm.org/ipfs-shipyard/npm-on-ipfs)\n\n**TLDR: npm-on-ipfs enables you to install your favourite modules from the distributed web using IPFS, as well as to have a cache always ready and shared on your local network — great for enterprise and community coding settings, or even just enabling more speedy work when you and your friends are working at a low-bandwidth coffee shop.**\n\n## Quick background\n\nAs the largest software registry in the world, [npm](https://www.npmjs.com) is also the de facto package manager for the JavaScript ecosystem, with more than [900k](https://replicate.npmjs.com/_all_docs) packages and more than 7 billion downloads a week. It's incredibly fast and reliable — however, we couldn't stop ourselves from wondering what would happen if we put the world's largest registry on the distributed web.\n\nThe result is npm-on-ipfs: a module that wraps your package manager of choice (npm or yarn) in configuration to use [IPFS](https://ipfs.io/), not HTTP, to retrieve your dependencies from the central npm registry. It's still a work in progress, but we think you'll find it useful and awesome for the following reasons:\n\n - Having dependencies on the distributed web makes development **more available** because multiple nodes supplying tarballs means no panic if a single source goes dark\n - It can also be **faster and cheaper** — if dependencies are already being hosted on your local network, this means lower bandwidth cost and higher speed \n - If enough dependencies are hosted on your local network (think enterprise or community development settings), that network can operate **offline-first**: Take your team on a remote mountain retreat and hack away!\n\n## Install \u0026 use\n\n```console\n$ npm i ipfs-npm -g\n```\n\n### Get started!\n\n`ipfs-npm` wraps your favorite package manager (npm or yarn) with configuration that uses IPFS, rather than HTTP, to retrieve your dependencies from the central npm registry. Since it's intended to replace npm/yarn, all the commands you're used to will work in the same way.\n\nFor example: In the directory with your `package.json` file, run ...\n\n```console\n$ ipfs-npm install\n👿 Spawning an in-process IPFS node\nSwarm listening on /ip4/127.0.0.1/tcp/57029/ipfs/QmVDtTRCoYyYu5JFdtrtBMS4ekPn8f9NndymoHdWuuJ7N2\n🗂️ Loading registry index from https://registry.js.ipfs.io\n☎️ Dialling registry mirror /ip4/35.178.192.119/tcp/10015/ipfs/QmWBaYSnmgZi6F6D69JuZGhyL8rm6pt8GX5r7Atc6Gd7vR,/dns4/registry.js.ipfs.io/tcp/10015/ipfs/QmWBaYSnmgZi6F6D69JuZGhyL8rm6pt8GX5r7Atc6Gd7vR\n🗑️ Replacing old registry index if it exists\n📠 Copying registry index /ipfs/QmQmVsNFw3stJky7agrETeB9kZqkcvLSLRnFFMrhiR8zG1 to /npm-registry\n👩‍🚀 Starting local proxy\n🚀 Server running on port 57314\n🎁 Installing dependencies with /Users/alex/.nvm/versions/node/v10.8.0/bin/npm\n...\n```\n\nYou can use any command you'd use with npm/yarn with ipfs-npm in exactly the same way:\n\n```console\n$ ipfs-npm install\n$ ipfs-npm version minor\n$ ipfs-npm publish\n$ ipfs-npm --package-manager=yarn\n// etc\n```\n\n## CLI guide\n\n```console\n$ ipfs-npm --help\nipfs-npm\n\nInstalls your js dependencies using IPFS\n\nOptions:\n  --help                        Show help                              [boolean]\n  --version                     Show version number                    [boolean]\n  --package-manager             Which package manager to use - eg. npm or yarn\n                                                                [default: \"npm\"]\n  --ipfs-registry               Where to download any packages that haven't made\n                                it into the registry index yet from\n                                        [default: \"https://registry.js.ipfs.io\"]\n  --registry-upload-size-limit  How large a file upload to allow when proxying\n                                for the registry             [default: \"1024MB\"]\n  --registry-update-interval    Only request the manifest for a given module\n                                every so many ms                [default: 60000]\n  --registry-connect-timeout    How long to wait while dialling the mirror\n                                before timing out                [default: 5000]\n  --registry-read-timeout       How long to wait for individual packages before\n                                timing out                       [default: 5000]\n  --ipfs-mfs-prefix             Which mfs prefix to use\n                                                      [default: \"/npm-registry\"]\n  --ipfs-node                   \"proc\" to start an in-process IPFS node,\n                                \"disposable\" to start an in-process disposable\n                                node, \"go\" or \"js\" to spawn an IPFS node as a\n                                separate process or a multiaddr that resolves to\n                                a running node                 [default: \"proc\"]\n  --ipfs-repo                   If --ipfs-node is set to \"proc\", this is the\n                                path that contains the IPFS repo to use\n                                                [default: \"/Users/alex/.jsipfs\"]\n  --ipfs-flush                  Whether to flush the MFS cache   [default: true]\n  --clone-pin                   Whether to pin cloned modules   [default: false]\n  --request-max-sockets         How many concurrent http requests to make while\n                                cloning the repo                   [default: 10]\n  --request-retries             How many times to retry when downloading\n                                manifests and tarballs from the registry\n                                                                    [default: 5]\n  --request-retry-delay         How long in ms to wait between retries\n                                                                 [default: 1000]\n  --request-timeout             How long in ms we should wait when requesting\n                                files                           [default: 30000]\n  --npm-registry                A fallback to use if the IPFS npm registry is\n                                unavailable\n                                         [default: \"https://registry.npmjs.com\"]\n```\n\n## Configuration files\n\nipfs-npm uses [`rc`](https://github.com/dominictarr/rc) to parse configuration files. Please see the [`rc` repository](https://github.com/dominictarr/rc#standards) for the order of precedence used when searching for configuration files. The app is `ipfs-npm`.\n\nFor instance, if you want to always use a remote daemon, you could create a `~/.ipfs-npmrc` file like this:\n\n```json\n{\n  \"ipfsNode\": \"/ip4/127.0.0.1/tcp/5001\"\n}\n```\n\n## To learn more\n\n[Protocol Labs](https://protocol.ai), the organization behind IPFS, is actively working on improving the landscape for package managers and the distributed web in 2019 and beyond. To that end, we've created an [IPFS Package Managers Special Interest Group](https://github.com/ipfs/package-managers), and your feedback and contributions are very welcome!\n\nIf you're actively (or just casually) using npm-on-ipfs and have feedback about your user experience, we'd love to hear from you, too. Please open an issue in the [Special Interest Group](https://github.com/ipfs/package-managers) and we'll get right back to you.\n\nMore resources you may find useful:\n- [The original npm-on-ipfs demo video](https://vimeo.com/147968322)\n- [A more detailed introduction to npm-on-ipfs from David Dias' blog](http://daviddias.me/blog/stellar-module-management/)\n- [Node.js Interactive talk on Stellar Module Management, aka npm-on-ipfs](https://www.youtube.com/watch?v=-S-Tc7Gl8FM)\n\n## Lead maintainer\n\n[Alex Potsides](https://github.com/achingbrain)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs-shipyard%2Fnpm-on-ipfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipfs-shipyard%2Fnpm-on-ipfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs-shipyard%2Fnpm-on-ipfs/lists"}