ipld
0.20.2

Intro

Installable via npm install --save ipld, it can also be used directly in the browser.

Download

The source is available for download from GitHub. Alternatively, you can install using npm:

$ npm install --save ipld

You can then require() ipld as normal:

const ipld = require('ipld')

In the Browser

Ipld should work in any ES2015 environment out of the box.

Usage:

<script type="text/javascript" src="index.js"></script>

The portable versions of ipld, including index.js and index.min.js, are included in the /dist folder. Ipld can also be found on unpkg.com under

getMany

Get multiple nodes back from an array of CIDs.

Parameters

  1. cids: Array<CID>:  
  2. callback: function (Error, Array):  

Returns

void

_maybeCID

Return a CID instance if it is a link.

If something is a link {"/": "baseencodedcid"} or a CID, then return a CID object, else return null.

Parameters

  1. link: any:  
    The object to check

Returns

CID? A CID instance

defaultOptions

Default options for IPLD.

Create an IPLD resolver with an in memory blockservice and repo.

Parameters

  1. callback: function (Error, IPLDResolver):  

Returns

void