diff --git a/README.md b/README.md index 8ec096e29..0000fa8b3 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ A valid (read: that follows this interface) IPFS core implementation, must expos ##### `JavaScript` - ipfs.object.new([callback]) -`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js) +`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode][] If no `callback` is passed, a promise is returned. @@ -84,13 +84,13 @@ If no `callback` is passed, a promise is returned. - Object, with format `{ Data: , Links: [] }` - Buffer, requiring that the encoding is specified on the options. If no encoding is specified, Buffer is treated as the Data field -- [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js). +- [DAGNode][] `options` is a optional argument of type object, that can contain the following properties: - `enc`, the encoding of the Buffer (json, yml, etc), if passed a Buffer. -`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js) +`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode][] If no `callback` is passed, a promise is returned. @@ -106,7 +106,7 @@ If no `callback` is passed, a promise is returned. ##### `JavaScript` - ipfs.object.get(multihash, [options, callback]) -`multihash` is a [multihash]() which can be passed as: +`multihash` is a [multihash][] which can be passed as: - Buffer, the raw Buffer of the multihash (or of and encoded version) - String, the toString version of the multihash (or of an encoded version) @@ -115,7 +115,7 @@ If no `callback` is passed, a promise is returned. - `enc`, the encoding of multihash (base58, base64, etc), if any. -`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js) +`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode][] If no `callback` is passed, a promise is returned. @@ -126,7 +126,7 @@ If no `callback` is passed, a promise is returned. ##### `Go` **WIP** ##### `JavaScript` - ipfs.object.data(multihash, [options, callback]) -`multihash` is a [multihash]() which can be passed as: +`multihash` is a [multihash][] which can be passed as: - Buffer, the raw Buffer of the multihash (or of and encoded version) - String, the toString version of the multihash (or of an encoded version) @@ -147,7 +147,7 @@ If no `callback` is passed, a promise is returned. ##### `JavaScript` - ipfs.object.links(multihash, [options, callback]) -`multihash` is a [multihash]() which can be passed as: +`multihash` is a [multihash][] which can be passed as: - Buffer, the raw Buffer of the multihash (or of and encoded version) - String, the toString version of the multihash (or of an encoded version) @@ -172,7 +172,7 @@ If no `callback` is passed, a promise is returned. ##### `JavaScript` - ipfs.object.stat(multihash, [options, callback]) -`multihash` is a [multihash]() which can be passed as: +`multihash` is a [multihash][] which can be passed as: - Buffer, the raw Buffer of the multihash (or of and encoded version) - String, the toString version of the multihash (or of an encoded version) @@ -212,7 +212,7 @@ If no `callback` is passed, a promise is returned. ##### `JavaScript` - ipfs.object.patch.addLink(multihash, DAGLink, [options, callback]) -`multihash` is a [multihash]() which can be passed as: +`multihash` is a [multihash][] which can be passed as: - Buffer, the raw Buffer of the multihash (or of and encoded version) - String, the toString version of the multihash (or of an encoded version) @@ -223,7 +223,7 @@ If no `callback` is passed, a promise is returned. - `enc`, the encoding of multihash (base58, base64, etc), if any. -`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js) that resulted by the operation of adding a Link. +`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode][] that resulted by the operation of adding a Link. If no `callback` is passed, a promise is returned. @@ -239,7 +239,7 @@ If no `callback` is passed, a promise is returned. ##### `JavaScript` - ipfs.object.patch.rmLink(multihash, DAGLink, [options, callback]) -`multihash` is a [multihash]() which can be passed as: +`multihash` is a [multihash][] which can be passed as: - Buffer, the raw Buffer of the multihash (or of and encoded version) - String, the toString version of the multihash (or of an encoded version) @@ -250,7 +250,7 @@ If no `callback` is passed, a promise is returned. - `enc`, the encoding of multihash (base58, base64, etc), if any. -`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js) that resulted by the operation of adding a Link. +`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode][] that resulted by the operation of adding a Link. If no `callback` is passed, a promise is returned. @@ -266,7 +266,7 @@ If no `callback` is passed, a promise is returned. ##### `JavaScript` - ipfs.object.patch.appendData(multihash, data, [options, callback]) -`multihash` is a [multihash]() which can be passed as: +`multihash` is a [multihash][] which can be passed as: - Buffer, the raw Buffer of the multihash (or of and encoded version) - String, the toString version of the multihash (or of an encoded version) @@ -277,7 +277,7 @@ If no `callback` is passed, a promise is returned. - `enc`, the encoding of multihash (base58, base64, etc), if any. -`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js) that resulted by the operation of adding a Link. +`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode][] that resulted by the operation of adding a Link. If no `callback` is passed, a promise is returned. @@ -293,7 +293,7 @@ If no `callback` is passed, a promise is returned. ##### `JavaScript` - ipfs.object.patch.setData(multihash, data, [options, callback]) -`multihash` is a [multihash]() which can be passed as: +`multihash` is a [multihash][] which can be passed as: - Buffer, the raw Buffer of the multihash (or of and encoded version) - String, the toString version of the multihash (or of an encoded version) @@ -304,6 +304,10 @@ If no `callback` is passed, a promise is returned. - `enc`, the encoding of multihash (base58, base64, etc), if any. -`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js) that resulted by the operation of adding a Link. +`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode][] that resulted by the operation of adding a Link. If no `callback` is passed, a promise is returned. + + +[DAGNode]: https://github.com/vijayee/js-ipfs-merkle-dag +[multihash]: http://github.com/jbenet/multihash