Forked IPLD by Evius
Last updated 2 years ago by hd_riqi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @evius/ipld 
SYNC missed versions from official npm registry.
IPLD hex logo

The JavaScript implementation of the IPLD

Travis CI Circle CI Coverage Status Dependency Status js-standard-style

The JavaScript implementation of the IPLD, InterPlanetary Linked-Data

Project Status

We've come a long way, but this project is still in Alpha, lots of development is happening, API might change, beware of the Dragons ????.

Want to get started? Check our examples folder. You can check the development status at the js-ipld Waffle Board.

Throughput Graph

Weekly Core Dev Calls

Tech Lead

Volker Mische

Lead Maintainer

Volker Mische

Table of Contents


> npm install --save ipld


const Ipld = require('ipld')
const IpfsRepo = require('ipfs-repo')
const IpfsBlockService = require('ipfs-block-service')

const initIpld = (ipfsRepoPath, callback) => {
  const repo = new IpfsRepo(ipfsRepoPath)
  repo.init({}, (err) => {
    if (err) {
      return callback(err)
    repo.open((err) => {
      if (err) {
        return callback(err)
      const blockService = new IpfsBlockService(repo)
      const ipld = new Ipld({blockService: blockService})
      return callback(null, ipld)

initIpld('/tmp/ifpsrepo', (err, ipld) => {
  // Do something with the `ipld`, e.g. `ipld.get(…)`


IPLD constructor

Creates and returns an instance of IPLD.

const ipld = new Ipld(options)

The options is an object with any of these properties:

Type Default
ipfs.BlockService instance Required (no default)


const blockService = new IpfsBlockService(repo)
const ipld = new Ipld({blockService: blockService})

.put(node, options, callback)

Store the given node of a recognized IPLD Format.

options is an object that must contain one of the following combinations:

  • cid - the CID of the node
  • [hashAlg], [version] and format - the hashAlg, version and the format that should be used to create the CID of the node. The hashAlg and version defaults to the default values for the format.

callback is a function that should have the signature as following: function (err, cid) {}, where err is an Error object in case of error and cid is the cid of the stored object.

.get(cid [, path] [, options], callback)

Retrieve a node by the given cid or cid + path

options is an optional object containing:

  • localResolve: bool - if true, get will only attempt to resolve the path locally

callback should be a function with the signature function (err, result), the result being an object with:

  • value - the value that resulted from the get
  • remainderPath - If it didn't manage to successfully resolve the whole path through or if simply the localResolve option was passed.

.getStream(cid [, path] [, options])

Same as get, but returns a source pull-stream that is used to pass the fetched node.

.treeStream(cid [, path] [, options])

Returns all the paths under a cid + path through a pull-stream. Accepts the following options:

  • recursive - bool - traverse through links to complete the graph.

.remove(cid, callback)

Remove a node by the given cid

.support.add(multicodec, formatResolver, formatUtil)

Add support to another IPLD Format


Removes support of an IPLD Format


Listing of dependencies from the IPLD ecosystem.

This table is generated using the module package-table with package-table --data=package-list.json.

Package Version Deps CI Coverage Lead Maintainer
IPLD Formats
ipld-bitcoin npm Deps jenkins codecov Volker Mische
ipld-dag-cbor npm Deps jenkins codecov Volker Mische
ipld-dag-pb npm Deps jenkins codecov Volker Mische
ipld-ethereum npm Deps N/A codecov kumavis
ipld-git npm Deps N/A codecov Volker Mische
ipld-raw npm Deps N/A codecov Volker Mische
ipld-zcash npm Deps jenkins codecov Volker Mische
Data Types (non IPLD specific)
multihashes npm Deps jenkins codecov David Dias
ipfs-block npm Deps jenkins codecov N/A
ipfs-repo npm Deps jenkins codecov Jacob Heun
interface-datastore npm Deps N/A codecov N/A
ipfs-block-service npm Deps jenkins codecov N/A
is-ipfs npm Deps jenkins codecov Marcin Rataj


Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.



Current Tags

  • 0.0.1                                ...           latest (2 years ago)

1 Versions

  • 0.0.1                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (16)
Dev Dependencies (9)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |