@@ -580,8 +580,8 @@ The Mutable File System (MFS) is a virtual file system on top of IPFS that expos
580
580
581
581
Where:
582
582
583
- - ` from ` is the path of the source object to copy.
584
- - ` to ` is the path of the destination object to copy to.
583
+ - ` from ` is the path of the source file to copy.
584
+ - ` to ` is the path of the destination file to copy to.
585
585
586
586
` callback ` must follow the ` function (err) {} ` signature, where ` err ` is an Error if the operation was not successful.
587
587
@@ -681,7 +681,7 @@ ipfs.files.stat('/file.txt', (err, stats) => {
681
681
682
682
Where:
683
683
684
- - ` path ` is the path of the object to remove.
684
+ - ` path ` is the path of the file to remove.
685
685
- ` options ` is an optional Object that might contain the following keys:
686
686
- ` recursive ` is a Boolean value to decide whether or not to remove directories recursively.
687
687
@@ -717,7 +717,7 @@ ipfs.files.rm('/my/beautiful/directory', { recursive: true }, (err) => {
717
717
718
718
Where:
719
719
720
- - ` path ` is the path of the object to read.
720
+ - ` path ` is the path of the file to read.
721
721
- ` options ` is an optional Object that might contain the following keys:
722
722
- ` offset ` is an Integer with the byte offset to begin reading from.
723
723
- ` count ` is an Integer with the maximum number of bytes to read.
@@ -746,7 +746,7 @@ ipfs.files.read('/hello-world', (err, buf) => {
746
746
747
747
Where:
748
748
749
- - ` path ` is the path of the object to read.
749
+ - ` path ` is the path of the file to read.
750
750
- ` options ` is an optional Object that might contain the following keys:
751
751
- ` offset ` is an Integer with the byte offset to begin reading from.
752
752
- ` count ` is an Integer with the maximum number of bytes to read.
@@ -771,11 +771,11 @@ ipfs.files.readReadableStream('/hello-world', (err, stream) => {
771
771
772
772
##### ` Go ` ** WIP**
773
773
774
- ##### ` JavaScript ` - ipfs.files.readReadableStream (path, [ options] , [ callback] )
774
+ ##### ` JavaScript ` - ipfs.files.readPullStream (path, [ options] , [ callback] )
775
775
776
776
Where:
777
777
778
- - ` path ` is the path of the object to read.
778
+ - ` path ` is the path of the file to read.
779
779
- ` options ` is an optional Object that might contain the following keys:
780
780
- ` offset ` is an Integer with the byte offset to begin reading from.
781
781
- ` count ` is an Integer with the maximum number of bytes to read.
@@ -808,10 +808,13 @@ ipfs.files.readPullStream('/hello-world', (err, stream) => {
808
808
809
809
Where:
810
810
811
- - ` path ` is the path of the object to write.
811
+ - ` path ` is the path of the file to write.
812
812
- ` 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)
815
818
- ` options ` is an optional Object that might contain the following keys:
816
819
- ` offset ` is an Integer with the byte offset to begin writing at.
817
820
- ` create ` is a Boolean to indicate to create the file if it doesn't exist.
@@ -840,8 +843,8 @@ ipfs.files.write('/hello-world', Buffer.from('Hello, world!'), (err) => {
840
843
841
844
Where:
842
845
843
- - ` from ` is the path of the source object to move.
844
- - ` to ` is the path of the destination object to move to.
846
+ - ` from ` is the path of the source file to move.
847
+ - ` to ` is the path of the destination file to move to.
845
848
846
849
` callback ` must follow the ` function (err) {} ` signature, where ` err ` is an Error if the operation was not successful.
847
850
@@ -924,3 +927,4 @@ ipfs.files.ls('/screenshots', function (err, files) {
924
927
[ rs ] : https://www.npmjs.com/package/readable-stream
925
928
[ ps ] : https://www.npmjs.com/package/pull-stream
926
929
[ cid ] : https://www.npmjs.com/package/cids
930
+ [ blob ] : https://developer.mozilla.org/en-US/docs/Web/API/Blob
0 commit comments