Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit ad99ac9

Browse files
committed
Merge pull request #2 from ipfs/tests/object-api
object api tests
2 parents 54b4053 + 478c03c commit ad99ac9

File tree

3 files changed

+632
-161
lines changed

3 files changed

+632
-161
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ A valid (read: that follows this interface) IPFS core implementation, must expos
6262
6363
##### `Go` **WIP**
6464

65-
##### `JavaScript` - ipfs.object.new(layout, [callback])
66-
67-
`layout` is the MerkleDAG node type, it can be: `null`, `'unixfs-dir'`, `'unixfs-raw'`, `'unixfs-file'`, `'unixfs-metadata'`, `'unixfs-symlink'`.
65+
##### `JavaScript` - ipfs.object.new([callback])
6866

6967
`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)
7068

@@ -85,8 +83,8 @@ If no `callback` is passed, a promise is returned.
8583
`obj` is the MerkleDAG Node to be stored. Can of type:
8684

8785
- Object, with format `{ Data: <data>, Links: [] }`
88-
- Buffer, requiring that the encoding is specified on the encoding
89-
- [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js). If no encoding is specified, Buffer is treated as the Data field.
86+
- Buffer, requiring that the encoding is specified on the options. If no encoding is specified, Buffer is treated as the Data field
87+
- [DAGNode](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js).
9088

9189
`options` is a optional argument of type object, that can contain the following properties:
9290

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
},
2121
"homepage": "https://github.com/ipfs/interface-ipfs-core#readme",
2222
"dependencies": {
23-
"chai": "^3.5.0"
23+
"bs58": "^3.0.0",
24+
"chai": "^3.5.0",
25+
"ipfs-merkle-dag": "^0.5.1",
26+
"json2yaml": "^1.1.0"
2427
}
2528
}

0 commit comments

Comments
 (0)