Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

crackcomm/js-to-ipfs

Repository files navigation

IPFS JavaScript source code packer

IPFN project IPFS project npm Dependency Status Dev Dependency Status Circle CI

Uploads npm packages to IPFS.

Converts occurences of require('package') in source code to require('Qm...').

Install

$ npm install -g js-to-ipfs

Usage

IPFS daemon should be running.

In node.js package directory run:

$ js-to-ipfs
QmVmMxoQYNBQ6rskr2ATPs1D6zKijXzMfn2CMf3chQxycR

Usage in code can be found in tests.

Running

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

Known issues

  • Dependencies need to be installed first.
  • Directories without package.json should not be in node_modules.
  • Uploads all dependencies in node_modules directory.
  • Recursive package requires.

TODO

  • Organizations includes @org/pkg.
  • Includes like: require('package/...').

License

                             Apache License
                       Version 2.0, January 2004
                    http://www.apache.org/licenses/