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

Commit

Permalink
Merge pull request #21 from ipfs/cat
Browse files Browse the repository at this point in the history
Interface for `ipfs.files.cat` (and alias `ipfs.cat`)
  • Loading branch information
daviddias committed Jun 6, 2016
2 parents 47828fd + 4fd85b6 commit 42a3a55
Show file tree
Hide file tree
Showing 2 changed files with 256 additions and 135 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,33 @@ ipfs.files.createAddStream(function (err, stream) {




### `cat`

> Streams the file at the given IPFS multihash..
##### `Go` **WIP**

##### `JavaScript` - ipfs.cat(multihash, [callback])

`multihash` is a [multihash][] which can be passed as

- Buffer, the raw Buffer of the multihash
- String, the base58 encoded version of the multihash

`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.

If no `callback` is passed, a promise is returned.

```js
ipfs.files.cat(multihash, function (err, file) {
// file will be a stream containing the data of the file requested
})
```




## Object

### `object.new`
Expand Down
Loading

0 comments on commit 42a3a55

Please sign in to comment.