GithubHelp home page GithubHelp logo

facundomarguello-goldofir / ipfs-connector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from akashaorg/ipfs-connector

0.0 1.0 0.0 1.21 MB

AKASHA <---> IPFS connector

License: Mozilla Public License 2.0

TypeScript 100.00%

ipfs-connector's Introduction

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/get data to ipfs
// cid zdpuB2CAUgUbyJ4s8SmqcGGaGfs7bG337dDNty8NSCR3fhgRw
const cid = instance.api.add({firstName: 'John', lastName: 'Doe'});
//returns John
instance.api.get(cid, '/firstName'); 

// read data from ipfs
instance.api.ipfsApi.cat('ipfs hash')

// access default ipfs-http-api from
instance.api.ipfsApi

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

ipfs-connector's People

Contributors

kenshyx avatar michaelmure avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.