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