@michaelmure/ipfs-connector
TypeScript icon, indicating that this package has built-in type declarations

1.12.2 • Public • Published

ipfs-connector

Build Status Coverage Status npm Known Vulnerabilities

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

CHANGELOG

LICENSE

Readme

Keywords

Package Sidebar

Install

npm i @michaelmure/ipfs-connector

Weekly Downloads

1

Version

1.12.2

License

MPL-2.0

Unpacked Size

250 kB

Total Files

18

Last publish

Collaborators

  • michaelmure