Uploads npm
packages to IPFS.
Converts occurences of require('package')
in source code to require('Qm...')
.
$ npm install -g js-to-ipfs
IPFS daemon should be running.
In node.js package directory run:
$ js-to-ipfs
QmVmMxoQYNBQ6rskr2ATPs1D6zKijXzMfn2CMf3chQxycR
Usage in code can be found in tests.
IPFS should be mounted at /ipfs
and NODE_PATH
should point to it.
$ ipfs mount
IPFS mounted at: /ipfs
IPNS mounted at: /ipns
$ export NODE_PATH=/ipfs
- Dependencies need to be installed first.
- Directories without
package.json
should not be innode_modules
. - Uploads all dependencies in
node_modules
directory. - Recursive package requires.
- Organizations includes
@org/pkg
. - Includes like:
require('package/...')
.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/