Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akashaorg/ipfs-connector
AKASHA <---> IPFS connector
https://github.com/akashaorg/ipfs-connector
akasha data-structures ipfs ipfs-connector js-api
Last synced: about 2 months ago
JSON representation
AKASHA <---> IPFS connector
- Host: GitHub
- URL: https://github.com/akashaorg/ipfs-connector
- Owner: AKASHAorg
- License: mpl-2.0
- Archived: true
- Created: 2016-05-13T16:21:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-09-12T11:15:26.000Z (about 4 years ago)
- Last Synced: 2024-09-26T17:00:21.685Z (about 2 months ago)
- Topics: akasha, data-structures, ipfs, ipfs-connector, js-api
- Language: TypeScript
- Homepage:
- Size: 1.57 MB
- Stars: 106
- Watchers: 18
- Forks: 23
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ipfs-connector
[![Build Status](https://travis-ci.org/AkashaProject/ipfs-connector.svg?branch=master)](https://travis-ci.org/AkashaProject/ipfs-connector)
[![Coverage Status](https://coveralls.io/repos/github/AkashaProject/ipfs-connector/badge.svg?branch=master)](https://coveralls.io/github/AkashaProject/ipfs-connector?branch=master)
[![npm](https://img.shields.io/npm/dm/@akashaproject/ipfs-connector.svg)](https://www.npmjs.com/package/@akashaproject/ipfs-connector)
[![Known Vulnerabilities](https://snyk.io/test/github/akashaproject/ipfs-connector/badge.svg)](https://snyk.io/test/github/akashaproject/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](https://github.com/ipfs/js-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](https://github.com/AkashaProject/ipfs-connector/tree/master/tests)For more information please see the [API docs](http://docs.akasha.world/ipfs-connector/index.html)
### Installation
```
npm install @akashaproject/ipfs-connector --save
```### Usage
```javascript
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](CHANGELOG.md)[LICENSE](LICENSE.md)