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

Commit d3bc7c8

Browse files
committed
cat
1 parent de2f861 commit d3bc7c8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
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)