@@ -162,9 +162,9 @@ pull(
162
162
163
163
##### ` Go ` ** WIP**
164
164
165
- ##### ` JavaScript ` - ipfs.files.cat(ipfsPath, [ callback] )
165
+ ##### ` JavaScript ` - ipfs.files.cat(ipfsPath, [ options ] , [ callback] )
166
166
167
- ipfsPath can be of type:
167
+ ` ipfsPath ` can be of type:
168
168
169
169
- [ ` cid ` ] [ cid ] of type:
170
170
- a [ CID] ( https://github.com/ipfs/js-cid ) instance
@@ -175,6 +175,10 @@ ipfsPath can be of type:
175
175
- '/ipfs/QmXEmhrMpbVvTh61FNAxP9nU7ygVtyvZA8HZDUaqQCAb66/a.txt'
176
176
- 'QmXEmhrMpbVvTh61FNAxP9nU7ygVtyvZA8HZDUaqQCAb66/a.txt'
177
177
178
+ ` options ` is an optional object that may contain the following keys:
179
+ - ` offset ` is an optional byte offset to start the stream at
180
+ - ` length ` is an optional number of bytes to read from the stream
181
+
178
182
` callback ` must follow ` function (err, file) {} ` signature, where ` err ` is an error if the operation was not successful and ` file ` is a [ Buffer] [ b ]
179
183
180
184
If no ` callback ` is passed, a promise is returned.
@@ -199,9 +203,9 @@ A great source of [examples][] can be found in the tests for this API.
199
203
200
204
##### ` Go ` ** WIP**
201
205
202
- ##### ` JavaScript ` - ipfs.files.catReadableStream(ipfsPath) -> [ Readable Stream] [ rs ]
206
+ ##### ` JavaScript ` - ipfs.files.catReadableStream(ipfsPath, [ options ] ) -> [ Readable Stream] [ rs ]
203
207
204
- ipfsPath can be of type:
208
+ ` ipfsPath ` can be of type:
205
209
206
210
- [ ` cid ` ] [ cid ] of type:
207
211
- a [ CID] ( https://github.com/ipfs/js-cid ) instance
@@ -212,6 +216,10 @@ ipfsPath can be of type:
212
216
- '/ipfs/QmXEmhrMpbVvTh61FNAxP9nU7ygVtyvZA8HZDUaqQCAb66/a.txt'
213
217
- 'QmXEmhrMpbVvTh61FNAxP9nU7ygVtyvZA8HZDUaqQCAb66/a.txt'
214
218
219
+ ` options ` is an optional object that may contain the following keys:
220
+ - ` offset ` is an optional byte offset to start the stream at
221
+ - ` length ` is an optional number of bytes to read from the stream
222
+
215
223
Returns a [ Readable Stream] [ rs ] with the contents of the file.
216
224
217
225
@@ -228,9 +236,9 @@ A great source of [examples][] can be found in the tests for this API.
228
236
229
237
##### ` Go ` ** WIP**
230
238
231
- ##### ` JavaScript ` - ipfs.files.catPullStream(ipfsPath) -> [ Pull Stream] [ rs ]
239
+ ##### ` JavaScript ` - ipfs.files.catPullStream(ipfsPath, [ options ] ) -> [ Pull Stream] [ rs ]
232
240
233
- ipfsPath can be of type:
241
+ ` ipfsPath ` can be of type:
234
242
235
243
- [ ` cid ` ] [ cid ] of type:
236
244
- [ Buffer] [ b ] , the raw Buffer of the cid
@@ -240,6 +248,10 @@ ipfsPath can be of type:
240
248
- '/ipfs/QmXEmhrMpbVvTh61FNAxP9nU7ygVtyvZA8HZDUaqQCAb66/a.txt'
241
249
- 'QmXEmhrMpbVvTh61FNAxP9nU7ygVtyvZA8HZDUaqQCAb66/a.txt'
242
250
251
+ ` options ` is an optional object that may contain the following keys:
252
+ - ` offset ` is an optional byte offset to start the stream at
253
+ - ` length ` is an optional number of bytes to read from the stream
254
+
243
255
Returns a [ Pull Stream] [ ps ] with the contents of the file.
244
256
245
257
``` JavaScript
0 commit comments