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