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

Commit 552fde2

Browse files
committed
docs: document mfs write content argument
1 parent 94801f1 commit 552fde2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

SPEC/FILES.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ ipfs.files.readReadableStream('/hello-world', (err, stream) => {
771771
772772
##### `Go` **WIP**
773773

774-
##### `JavaScript` - ipfs.files.readReadableStream(path, [options], [callback])
774+
##### `JavaScript` - ipfs.files.readPullStream(path, [options], [callback])
775775

776776
Where:
777777

@@ -810,8 +810,11 @@ Where:
810810

811811
- `path` is the path of the object to write.
812812
- `content` can be:
813-
- a Buffer instance.
814-
- a Path (caveat: will only work in Node.js).
813+
- a [`Buffer`][b]
814+
- a [`PullStream`][ps]
815+
- a [`ReadableStream`][rs]
816+
- a [`Blob`][blob] (caveat: will only work in the browser)
817+
- a string path to a file (caveat: will only work in Node.js)
815818
- `options` is an optional Object that might contain the following keys:
816819
- `offset` is an Integer with the byte offset to begin writing at.
817820
- `create` is a Boolean to indicate to create the file if it doesn't exist.
@@ -924,3 +927,4 @@ ipfs.files.ls('/screenshots', function (err, files) {
924927
[rs]: https://www.npmjs.com/package/readable-stream
925928
[ps]: https://www.npmjs.com/package/pull-stream
926929
[cid]: https://www.npmjs.com/package/cids
930+
[blob]: https://developer.mozilla.org/en-US/docs/Web/API/Blob

0 commit comments

Comments
 (0)