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

Commit 4904f4a

Browse files
authored
Merge pull request #107 from ipfs/feat/importer-options
docs: documenting importer options
2 parents 44d70eb + b423646 commit 4904f4a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

API/files/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ files API
77
88
##### `Go` **WIP**
99

10-
##### `JavaScript` - ipfs.files.add(data, [callback])
10+
##### `JavaScript` - ipfs.files.add(data, [options], [callback])
1111

1212
Where `data` may be
1313

@@ -23,6 +23,8 @@ Where `data` may be
2323

2424
If no `content` is passed, then the path is treated as an empty directory
2525

26+
`options` is an optional object argument containing the [DAG importer options](https://github.com/ipfs/js-ipfs-unixfs-engine#importer-api).
27+
2628
`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of:
2729

2830
```js
@@ -56,7 +58,7 @@ ipfs.files.add(files, function (err, files) {
5658
5759
##### `Go` **WIP**
5860

59-
##### `JavaScript` - ipfs.files.createAddStream([callback])
61+
##### `JavaScript` - ipfs.files.createAddStream([options], [callback])
6062

6163
Provides a Transform stream, where objects can be written of the forms
6264

@@ -67,6 +69,8 @@ Provides a Transform stream, where objects can be written of the forms
6769
}
6870
```
6971

72+
`options` is an optional object argument containing the [DAG importer options](https://github.com/ipfs/js-ipfs-unixfs-engine#importer-api).
73+
7074
`callback` must follow `function (err, stream) {}` signature, where `err` is an
7175
error if the operation was not successful. `stream` will be a Transform stream,
7276
to which tuples like the above two object formats can be written and [DAGNode][]
@@ -105,7 +109,7 @@ ipfs.files.createAddStream(function (err, stream) {
105109

106110
`multihash` is a [multihash][] which can be passed as
107111

108-
- Buffer, the raw Buffer of the multihash
112+
- Buffer, the raw Buffer of the multihash
109113
- String, the base58 encoded version of the multihash
110114

111115
`callback` must follow `function (err, stream) {}` signature, where `err` is an error if the operation was not successful and `stream` is a readable stream of the file.

0 commit comments

Comments
 (0)