Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 4fd85b6

Browse files
nginneverdaviddias
authored andcommitted
cat
1 parent 47828fd commit 4fd85b6

File tree

2 files changed

+256
-135
lines changed

2 files changed

+256
-135
lines changed

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,33 @@ ipfs.files.createAddStream(function (err, stream) {
148148

149149

150150

151+
152+
### `cat`
153+
154+
> Streams the file at the given IPFS multihash..
155+
156+
##### `Go` **WIP**
157+
158+
##### `JavaScript` - ipfs.cat(multihash, [callback])
159+
160+
`multihash` is a [multihash][] which can be passed as
161+
162+
- Buffer, the raw Buffer of the multihash
163+
- String, the base58 encoded version of the multihash
164+
165+
`callback` must follow `function (err, stream) {}` signature, where `err` is an error if the operation was not successful and `stream` is a readable stream of the file.
166+
167+
If no `callback` is passed, a promise is returned.
168+
169+
```js
170+
ipfs.files.cat(multihash, function (err, file) {
171+
// file will be a stream containing the data of the file requested
172+
})
173+
```
174+
175+
176+
177+
151178
## Object
152179

153180
### `object.new`

0 commit comments

Comments
 (0)