Intro
Installable via npm install --save ipld-dag-cbor, 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-dag-cbor
You can then require() ipld-dag-cbor as normal:
const ipldDagCbor = require('ipld-dag-cbor')
In the Browser
Ipld-dag-cbor should work in any ES2015 environment out of the box.
Usage:
<script type="text/javascript" src="index.js"></script>
The portable versions of ipld-dag-cbor, including index.js and index.min.js, are included in the /dist folder. Ipld-dag-cbor can also be found on unkpkg.com under
CidCallback
Parameters
error: Error?:Error if getting the CID failedcid: CID?:CID if call was successful
cid
Get the CID of the DAG-Node.
Parameters
dagNode: Object:Internal representationoptions: Object?:Options to create the CIDoptions.version: number (=1):CID version numberoptions.hashAlg: string?:Defaults to hashAlg for the resolvercallback: CidCallback:Callback that handles the return value
Returns
void