diff --git a/API/files/README.md b/API/files/README.md index 6d2ab6d9f..f29899ce6 100644 --- a/API/files/README.md +++ b/API/files/README.md @@ -7,7 +7,7 @@ files API ##### `Go` **WIP** -##### `JavaScript` - ipfs.files.add(data, [callback]) +##### `JavaScript` - ipfs.files.add(data, [options], [callback]) Where `data` may be @@ -23,6 +23,8 @@ Where `data` may be If no `content` is passed, then the path is treated as an empty directory +`options` is an optional object argument containing the [DAG importer options](https://github.com/ipfs/js-ipfs-unixfs-engine#importer-api). + `callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of: ```js @@ -56,7 +58,7 @@ ipfs.files.add(files, function (err, files) { ##### `Go` **WIP** -##### `JavaScript` - ipfs.files.createAddStream([callback]) +##### `JavaScript` - ipfs.files.createAddStream([options], [callback]) Provides a Transform stream, where objects can be written of the forms @@ -67,6 +69,8 @@ Provides a Transform stream, where objects can be written of the forms } ``` +`options` is an optional object argument containing the [DAG importer options](https://github.com/ipfs/js-ipfs-unixfs-engine#importer-api). + `callback` must follow `function (err, stream) {}` signature, where `err` is an error if the operation was not successful. `stream` will be a Transform stream, to which tuples like the above two object formats can be written and [DAGNode][] @@ -105,7 +109,7 @@ ipfs.files.createAddStream(function (err, stream) { `multihash` is a [multihash][] which can be passed as -- Buffer, the raw Buffer of the multihash +- Buffer, the raw Buffer of the multihash - String, the base58 encoded version of the multihash `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.