@@ -159,9 +159,9 @@ pull(
159
159
160
160
##### ` Go ` ** WIP**
161
161
162
- ##### ` JavaScript ` - ipfs.files.cat(ipfsPath, [ callback] )
162
+ ##### ` JavaScript ` - ipfs.files.cat(ipfsPath, [ options ] , [ callback] )
163
163
164
- ipfsPath can be of type:
164
+ ` ipfsPath ` can be of type:
165
165
166
166
- [ ` cid ` ] [ cid ] of type:
167
167
- a [ CID] ( https://github.com/ipfs/js-cid ) instance
@@ -172,6 +172,10 @@ ipfsPath can be of type:
172
172
- '/ipfs/QmXEmhrMpbVvTh61FNAxP9nU7ygVtyvZA8HZDUaqQCAb66/a.txt'
173
173
- 'QmXEmhrMpbVvTh61FNAxP9nU7ygVtyvZA8HZDUaqQCAb66/a.txt'
174
174
175
+ ` options ` is an optional object that may contain the following keys:
176
+ - ` offset ` is an optional byte offset to start the stream at
177
+ - ` count ` is an optional number of bytes to read from the stream
178
+
175
179
` callback ` must follow ` function (err, file) {} ` signature, where ` err ` is an error if the operation was not successful and ` file ` is a [ Buffer] [ b ]
176
180
177
181
If no ` callback ` is passed, a promise is returned.
@@ -196,9 +200,9 @@ A great source of [examples][] can be found in the tests for this API.
196
200
197
201
##### ` Go ` ** WIP**
198
202
199
- ##### ` JavaScript ` - ipfs.files.catReadableStream(ipfsPath) -> [ Readable Stream] [ rs ]
203
+ ##### ` JavaScript ` - ipfs.files.catReadableStream(ipfsPath, [ options ] ) -> [ Readable Stream] [ rs ]
200
204
201
- ipfsPath can be of type:
205
+ ` ipfsPath ` can be of type:
202
206
203
207
- [ ` cid ` ] [ cid ] of type:
204
208
- a [ CID] ( https://github.com/ipfs/js-cid ) instance
@@ -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