@@ -599,8 +599,8 @@ The Mutable File System (MFS) is a virtual file system on top of IPFS that expos
599
599
600
600
Where:
601
601
602
- - ` from ` is the path of the source object to copy.
603
- - ` to ` is the path of the destination object to copy to.
602
+ - ` from ` is the path of the source file to copy.
603
+ - ` to ` is the path of the destination file to copy to.
604
604
605
605
` callback ` must follow the ` function (err) {} ` signature, where ` err ` is an Error if the operation was not successful.
606
606
@@ -700,7 +700,7 @@ ipfs.files.stat('/file.txt', (err, stats) => {
700
700
701
701
Where:
702
702
703
- - ` path ` is the path of the object to remove.
703
+ - ` path ` is the path of the file to remove.
704
704
- ` options ` is an optional Object that might contain the following keys:
705
705
- ` recursive ` is a Boolean value to decide whether or not to remove directories recursively.
706
706
@@ -736,7 +736,7 @@ ipfs.files.rm('/my/beautiful/directory', { recursive: true }, (err) => {
736
736
737
737
Where:
738
738
739
- - ` path ` is the path of the object to read.
739
+ - ` path ` is the path of the file to read.
740
740
- ` options ` is an optional Object that might contain the following keys:
741
741
- ` offset ` is an Integer with the byte offset to begin reading from.
742
742
- ` count ` is an Integer with the maximum number of bytes to read.
@@ -765,7 +765,7 @@ ipfs.files.read('/hello-world', (err, buf) => {
765
765
766
766
Where:
767
767
768
- - ` path ` is the path of the object to read.
768
+ - ` path ` is the path of the file to read.
769
769
- ` options ` is an optional Object that might contain the following keys:
770
770
- ` offset ` is an Integer with the byte offset to begin reading from.
771
771
- ` count ` is an Integer with the maximum number of bytes to read.
@@ -790,11 +790,11 @@ ipfs.files.readReadableStream('/hello-world', (err, stream) => {
790
790
791
791
##### ` Go ` ** WIP**
792
792
793
- ##### ` JavaScript ` - ipfs.files.readReadableStream (path, [ options] , [ callback] )
793
+ ##### ` JavaScript ` - ipfs.files.readPullStream (path, [ options] , [ callback] )
794
794
795
795
Where:
796
796
797
- - ` path ` is the path of the object to read.
797
+ - ` path ` is the path of the file to read.
798
798
- ` options ` is an optional Object that might contain the following keys:
799
799
- ` offset ` is an Integer with the byte offset to begin reading from.
800
800
- ` count ` is an Integer with the maximum number of bytes to read.
@@ -827,10 +827,13 @@ ipfs.files.readPullStream('/hello-world', (err, stream) => {
827
827
828
828
Where:
829
829
830
- - ` path ` is the path of the object to write.
830
+ - ` path ` is the path of the file to write.
831
831
- ` content ` can be:
832
- - a Buffer instance.
833
- - a Path (caveat: will only work in Node.js).
832
+ - a [ ` Buffer ` ] [ b ]
833
+ - a [ ` PullStream ` ] [ ps ]
834
+ - a [ ` ReadableStream ` ] [ rs ]
835
+ - a [ ` Blob ` ] [ blob ] (caveat: will only work in the browser)
836
+ - a string path to a file (caveat: will only work in Node.js)
834
837
- ` options ` is an optional Object that might contain the following keys:
835
838
- ` offset ` is an Integer with the byte offset to begin writing at.
836
839
- ` create ` is a Boolean to indicate to create the file if it doesn't exist.
@@ -859,8 +862,8 @@ ipfs.files.write('/hello-world', Buffer.from('Hello, world!'), (err) => {
859
862
860
863
Where:
861
864
862
- - ` from ` is the path of the source object to move.
863
- - ` to ` is the path of the destination object to move to.
865
+ - ` from ` is the path of the source file to move.
866
+ - ` to ` is the path of the destination file to move to.
864
867
865
868
` callback ` must follow the ` function (err) {} ` signature, where ` err ` is an Error if the operation was not successful.
866
869
@@ -943,3 +946,4 @@ ipfs.files.ls('/screenshots', function (err, files) {
943
946
[ rs ] : https://www.npmjs.com/package/readable-stream
944
947
[ ps ] : https://www.npmjs.com/package/pull-stream
945
948
[ cid ] : https://www.npmjs.com/package/cids
949
+ [ blob ] : https://developer.mozilla.org/en-US/docs/Web/API/Blob
0 commit comments