JavaScript Implementation of the IPLD Format MerkleDAG Node in Protobuf.
> npm i ipld-dag-pb
const dagPB = require('ipld-dag-pb')
// then, to access each of the components
dagPB.DAGNode
dagPB.resolver
Create a new DAGNode
var node = new dagPB.DAGNode([<data>, <[links]>])
creates a link on node A to node B by using node B to get its multihash
creates a link on node A to node B by using directly node B multihash
updates a link on the node. caution this method returns a copy of the MerkleDAG node
removes a link from the node by name
removes a link from the node by the hash of the linked node
creates a clone of the MerkleDAG Node
(property) size of the node, in bytes
(property) an array of
DAGLink
s belonging to the node
returns the multihash (default: sha2-256)
used internally
used internally
Create a new DAGLink
var link = new dagPB.DAGLink(<name>, <size>, <hash>)
MIT © IPFS