@michaelmure/ipfs-connector
v1.12.2
Published
Ipfs download/process manager
Downloads
7
Readme
ipfs-connector
Library for solving the cross-platform binaries problem (works on Windows as well) containing helpers for easier read/write on IPFS by extending the JavaScript IPFS API functionality.
Some of the differences:
- Able to specify init folder
- Promised based, no callbacks
- Connector can be accessed from anywhere inside the app as it is a singleton
- Plug your favorite logging library (by default console). See tests folder
For more information please see the API docs
Installation
npm install @akashaproject/ipfs-connector --save
Usage
import { IpfsConnector } from '@akashaproject/ipfs-connector';
const instance = IpfsConnector.getInstance();
// start ipfs daemon and download binaries if needed
instance.start().then((api) => {});
// stop daemon
instance.stop()
// see api docs
// add data to ipfs
instance.api.add(object | Buffer)
// read data from ipfs
instance.api.get('ipfs hash')
// resolve ipfs hash object paths(see tests)
// access default js-ipfs-api from
instance.api.apiClient
Dev
git clone https://github.com/AkashaProject/ipfs-connector.git
cd ipfs-connector
// install dependencies
npm install
// run tests
npm test
// generate docs
npm run docs