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
_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
link: any
:The object to check
Returns
CID?
A CID instance
Create an IPLD resolver with an in memory blockservice and repo.
Parameters
callback: function (Error, IPLDResolver)
:
Returns
void