• Stars
    star
    464
  • Rank 94,450 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ“ฆ Install npm modules through IPFS!

npm distributed on top of lots of connected IPFS nodes worldwide

npm-on-IPFS

Build Status Code Coverage Dependency Status

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.

Quick background

As the largest software registry in the world, npm is also the de facto package manager for the JavaScript ecosystem, with more than 900k 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.

The result is npm-on-ipfs: a module that wraps your package manager of choice (npm or yarn) in configuration to use IPFS, 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:

  • Having dependencies on the distributed web makes development more available because multiple nodes supplying tarballs means no panic if a single source goes dark
  • 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
  • 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!

Install & use

$ npm i ipfs-npm -g

Get started!

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.

For example: In the directory with your package.json file, run ...

$ ipfs-npm install
๐Ÿ‘ฟ Spawning an in-process IPFS node
Swarm listening on /ip4/127.0.0.1/tcp/57029/ipfs/QmVDtTRCoYyYu5JFdtrtBMS4ekPn8f9NndymoHdWuuJ7N2
๐Ÿ—‚๏ธ Loading registry index from https://registry.js.ipfs.io
โ˜Ž๏ธ Dialling registry mirror /ip4/35.178.192.119/tcp/10015/ipfs/QmWBaYSnmgZi6F6D69JuZGhyL8rm6pt8GX5r7Atc6Gd7vR,/dns4/registry.js.ipfs.io/tcp/10015/ipfs/QmWBaYSnmgZi6F6D69JuZGhyL8rm6pt8GX5r7Atc6Gd7vR
๐Ÿ—‘๏ธ Replacing old registry index if it exists
๐Ÿ“  Copying registry index /ipfs/QmQmVsNFw3stJky7agrETeB9kZqkcvLSLRnFFMrhiR8zG1 to /npm-registry
๐Ÿ‘ฉโ€๐Ÿš€ Starting local proxy
๐Ÿš€ Server running on port 57314
๐ŸŽ Installing dependencies with /Users/alex/.nvm/versions/node/v10.8.0/bin/npm
...

You can use any command you'd use with npm/yarn with ipfs-npm in exactly the same way:

$ ipfs-npm install
$ ipfs-npm version minor
$ ipfs-npm publish
$ ipfs-npm --package-manager=yarn
// etc

CLI guide

$ ipfs-npm --help
ipfs-npm

Installs your js dependencies using IPFS

Options:
  --help                        Show help                              [boolean]
  --version                     Show version number                    [boolean]
  --package-manager             Which package manager to use - eg. npm or yarn
                                                                [default: "npm"]
  --ipfs-registry               Where to download any packages that haven't made
                                it into the registry index yet from
                                        [default: "https://registry.js.ipfs.io"]
  --registry-upload-size-limit  How large a file upload to allow when proxying
                                for the registry             [default: "1024MB"]
  --registry-update-interval    Only request the manifest for a given module
                                every so many ms                [default: 60000]
  --registry-connect-timeout    How long to wait while dialling the mirror
                                before timing out                [default: 5000]
  --registry-read-timeout       How long to wait for individual packages before
                                timing out                       [default: 5000]
  --ipfs-mfs-prefix             Which mfs prefix to use
                                                      [default: "/npm-registry"]
  --ipfs-node                   "proc" to start an in-process IPFS node,
                                "disposable" to start an in-process disposable
                                node, "go" or "js" to spawn an IPFS node as a
                                separate process or a multiaddr that resolves to
                                a running node                 [default: "proc"]
  --ipfs-repo                   If --ipfs-node is set to "proc", this is the
                                path that contains the IPFS repo to use
                                                [default: "/Users/alex/.jsipfs"]
  --ipfs-flush                  Whether to flush the MFS cache   [default: true]
  --clone-pin                   Whether to pin cloned modules   [default: false]
  --request-max-sockets         How many concurrent http requests to make while
                                cloning the repo                   [default: 10]
  --request-retries             How many times to retry when downloading
                                manifests and tarballs from the registry
                                                                    [default: 5]
  --request-retry-delay         How long in ms to wait between retries
                                                                 [default: 1000]
  --request-timeout             How long in ms we should wait when requesting
                                files                           [default: 30000]
  --npm-registry                A fallback to use if the IPFS npm registry is
                                unavailable
                                         [default: "https://registry.npmjs.com"]

Configuration files

ipfs-npm uses rc to parse configuration files. Please see the rc repository for the order of precedence used when searching for configuration files. The app is ipfs-npm.

For instance, if you want to always use a remote daemon, you could create a ~/.ipfs-npmrc file like this:

{
  "ipfsNode": "/ip4/127.0.0.1/tcp/5001"
}

To learn more

Protocol Labs, 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, and your feedback and contributions are very welcome!

If 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 and we'll get right back to you.

More resources you may find useful:

Lead maintainer

Alex Potsides

More Repositories

1

ipfs-deploy

Zero-Config CLI to Deploy Static Websites to IPFS
JavaScript
1,160
star
2

py-ipfs-http-client

A python client library for the IPFS API
Python
661
star
3

java-ipfs-http-client

A Java implementation of the HTTP IPFS API
Java
537
star
4

py-ipfs

python implementation of ipfs
Python
475
star
5

gomobile-ipfs

IPFS and libp2p on Mobile, with Gomobile
Java
318
star
6

ipfs-primer

A primer explaining IPFS and the Decentralized Web, viewable as a website, pdf or e-book
CSS
287
star
7

ipfs-pubsub-room

IPFS Pubsub room
JavaScript
283
star
8

ipscend

๐Ÿš€ Publish all your Web pages to IPFS, track released versions and more!
JavaScript
262
star
9

swift-ipfs-http-client

A Swift client library for the IPFS HTTP API.
Swift
196
star
10

ipfs-share-files

Share files via IPFS
JavaScript
145
star
11

git-remote-ipld

Go
144
star
12

nft-school-examples

JavaScript
143
star
13

is-ipfs

A set of utilities to help identify IPFS resources on the web
TypeScript
126
star
14

shared-editing-demo

Demo of shared text editing using Yjs and IPFS
JavaScript
104
star
15

ipfs-service-worker-demos

[INACTIVE/DEPRECATED] Demo ~2017: run an IPFS node inside a Service Worker and serve all your IPFS URLs directly from IPFS!
JavaScript
84
star
16

ipfs-pack

ipfs-pack filesystem packing tool
Go
72
star
17

ipfs-geoip

geoip lookup over DAG-CBOR dataset loaded from IPFS
JavaScript
70
star
18

IGiS

Interplanetary Git Service
JavaScript
69
star
19

ipfs-github-action

Pin your site to IPFS from a GitHub Action
Shell
68
star
20

pm-idm

IDM project management repository
63
star
21

dnslink-cloudflare

Update dnslink TXT records in Cloudflare
JavaScript
63
star
22

service-worker-gateway-2019-poc

[ARCHIVED] 2019 PoC of IPFS gateway fully running on a Service Worker. For modern (2024+) version see https://github.com/ipfs-shipyard/service-worker-gateway
JavaScript
61
star
23

peer-crdt

Peer CRDT
JavaScript
60
star
24

tevere

๐Ÿž Decentralized DB over IPFS
JavaScript
59
star
25

dnslink-deploy

Set the DNS records on Digital Ocean programmatically
JavaScript
58
star
26

y-ipfs-connector

Y.js connector over IPFS
JavaScript
57
star
27

ipfs-blob-store

An abstract-blob-store compatible implementation built using IPFS as the storage backend
JavaScript
56
star
28

ipfs-pubsub-room-demo

IPFS Pubsub room demo
JavaScript
53
star
29

Durin

Native mobile apps for share actions on iOS and Android
TypeScript
46
star
30

shipyard

Main entry repo for the IPFS Shipyard
45
star
31

container-demos

ipfs container demos
Makefile
44
star
32

discussify-browser-extension

Discussify's browser extension app
JavaScript
40
star
33

ipfs-dns-deploy

A circleci friendly Docker image for pinning things to cluster and updating dns
Shell
38
star
34

net-ipfs-http-client

InterPlanetary File System client for .Net (C#, VB, F# ...)
C#
38
star
35

scala-ipfs-api

A wrapper of the IPFS Client HTTP-API for Scala.
Scala
34
star
36

js-ipfs-http-client-lite

An alternative client library for the IPFS HTTP API, aiming to be as lightweight as possible (<20kB) in the browser.
JavaScript
34
star
37

js-human-crypto-keys

Generate and import human-friendly cryptographic keys using mnemonics, QR codes and other methods
JavaScript
33
star
38

ipfs-provider

Connect to IPFS via an available provider
JavaScript
33
star
39

cube

IPFS Cube will help people deploy and manage their own IPFS pinning services on top of existing cheap hardware, or cloud storage.
Clojure
32
star
40

js-ipfs-level

Leveldown over IPFS
JavaScript
30
star
41

workshop-todo-dapp

A workshop into adding realtime collaboration in a typical To-do app
JavaScript
29
star
42

dataviz

ipfs data visualizations
CoffeeScript
29
star
43

react-native-ipfs-demo

Demo app exploring IPFS in React Native.
JavaScript
29
star
44

ipfs-live-db

Live CRDT DB over IPFS
28
star
45

ipfs-check

A tool for checking the accessibility of your data by IPFS peers
Go
27
star
46

ecosystem-dashboard

A dashboard for monitoring the ecosystem around an open source project.
Ruby
27
star
47

ipfs-npm-OLD

Please refer to https://github.com/ipfs-shipyard/npm-on-ipfs
JavaScript
27
star
48

ipfs-cohost

A CLI to co-host websites published to IPFS
JavaScript
26
star
49

vole

a collection of tools for digging around IPFS nodes
Go
26
star
50

demo-ipfs-id-qr-codes

Generates a QR Code of your IPNS URL and Public Key
HTML
25
star
51

cohosting

A set of light tools and conventions for cohosting public websites and files on IPFS
Shell
25
star
52

ipfs-pubsub-1on1

1-to-1 communication channel over IPFS Pubsub between two peers
JavaScript
25
star
53

ipfs-css

The single-purpose css class names and font-face config to IPFS up your UI.
HTML
24
star
54

ipfs-dag-builder-vis

See how the DAGs get built
JavaScript
24
star
55

rb-pinning-service-api

A rails app that implements the IPFS Pinning Service API
Ruby
23
star
56

i18n

IPFS Translation Project
22
star
57

peer-pad-core

๐Ÿ“ PeerPad core API (no UI)
JavaScript
22
star
58

nopfs

Say NO with NOpfs! NOpfs provides content-blocking-layer capabilities for IPFS (Kubo).
Go
21
star
59

ipfs-senc

Simple tarball encryption
CSS
21
star
60

js-did-ipid

The IPID DID method implementation in JavaScript
JavaScript
21
star
61

peer-crdt-ipfs

peer-crdt network and store over IPFS
JavaScript
20
star
62

net-ipfs-core

C#
19
star
63

ipfs-npm-registry-mirror

Clone the NPM registry into IPFS
JavaScript
19
star
64

apt-on-ipfs

A Docker image that installs ubuntu packages via IPFS
Dockerfile
19
star
65

space

Rust
18
star
66

demo-ipfs-todo

Simple ToDo app using window.ipfs
JavaScript
17
star
67

ipfsx

Experimental IPFS API
JavaScript
17
star
68

pm-discussify

Discussify's project management repository
HTML
17
star
69

package-table

Auto generate a module table in markdown from JSON
JavaScript
16
star
70

integration-mini-projects

Ideas and tracking for small one week "mini projects" that integrate across IPFS
14
star
71

paperhub

Sharing scientific papers using ipfs
JavaScript
14
star
72

pinning-service-compliance

This repo checks the compliance of IPFS Pinning Services against the pinning spec
TypeScript
14
star
73

nomios.io

The https://nomios.io website repository
JavaScript
13
star
74

js-crypto-key-composer

A library to parse crypto keys in different types and formats
JavaScript
12
star
75

go-ipfs-desktop

Go
12
star
76

ipfs-thing-2022

ipfs-รพing-2022
JavaScript
12
star
77

ipfs-iiif-db

IIIF annotations JS client on top of IPFS
JavaScript
12
star
78

react-ipfs-url

Grab a URL from a IPFS path by using URL.createObjectURL
JavaScript
12
star
79

camp-course-c-demo

IPFS Camp 2019 Course C Materials
HTML
11
star
80

ipfs-npm-republish

๐Ÿ“ฆ Republish your node project's dependencies to IPFS as a micro-registry
JavaScript
11
star
81

ipfs-hubot

hubot for ipfs
CoffeeScript
11
star
82

js-idm-wallet

The reference implementation of the IDM Wallet in JavaScript
JavaScript
10
star
83

workshop-idm-chat-dapp

The IDM mini-chat DApp workshop
JavaScript
10
star
84

ipfs-http

A REST and GraphQL interface to IPFS
Go
10
star
85

go-ipfs-docker-examples

Shell
9
star
86

js-pinning-service-http-client

An IPFS Pinning Service HTTP Client for TypeScript / Javascript
TypeScript
9
star
87

DAGger

๐Ÿ—ก๏ธ - an elegant slicer for a more civilized age
Shell
8
star
88

thunderdome

Go
8
star
89

nomios-web-uikit

A collection of shared react components to be used in the Nomios Identity Wallet
JavaScript
8
star
90

ipfs-or-gateway

Download an hash via IPFS, falling back to an HTTP Gateway
JavaScript
8
star
91

w3rc

A Web3 Retrieval Client
Go
8
star
92

dnslink-dnsimple

Update dnslink TXT records in DNSimple
Go
8
star
93

nomios-web

The reference IDM wallet based on web technologies
JavaScript
8
star
94

ipfs-thing-2023

ipfs-รพing-2023
TypeScript
8
star
95

ipfs-pubsub-peer-monitor

Monitor peers joining and leaving an IPFS PubSub topic
JavaScript
8
star
96

someguy

A Delegated Routing V1 server and client for all your routing needs.
Go
7
star
97

js-libp2p-react-native

A demo app running js-libp2p in a React Native app
Java
7
star
98

js-mock-ipfs-pinning-service

Implementation of in-memory IPFS Pinning Service API
JavaScript
7
star
99

js-versidag

Concurrent version history based on a Merkle-DAG
JavaScript
6
star
100

go-dumpotron

Take pprof dumps when a go process eats too much ram or cpu
Go
6
star