ipfs-client
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "ipfs-client", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A Node.JS client library for the Inter-Planetary File System", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,27 +0,29 @@ | ||
# TOC | ||
- [add(stream, cb(err, hash))](#addstream-cberr-hash) | ||
- [cat(hash)](#cathash) | ||
<a name=""></a> | ||
<a name="addstream-cberr-hash"></a> | ||
# add(stream, cb(err, hash)) | ||
should return a hash of the given stream. | ||
# IPFS Node.JS Client | ||
This library is a simple client for the [InterPlanetary File System](http://ipfs.io). It currently supports the operations of storing and retrieving file content in IPFS. | ||
```js | ||
$S.run(gen, done); | ||
## Installing | ||
``` | ||
npm --save install ipfs-client | ||
``` | ||
<a name="cathash"></a> | ||
# cat(hash) | ||
should return a readable stream producing the file underlying the hash. | ||
## API | ||
### cat - Streaming content out of IPFS | ||
Example: | ||
```js | ||
var ipfs = require('ipfs-client'); | ||
```js | ||
$S.run(gen, done); | ||
var stream = ipfs.cat('QmTE9Xp76E67vkYeygbKJrsVj8W2LLcyUifuMHMEkyRfUL'); | ||
stream.pipe(process.stdout); | ||
``` | ||
should report error if hash is not found. | ||
### add - Store the Content of a Stream | ||
Provides a hash in return. | ||
Example: | ||
```js | ||
$S.run(gen, done); | ||
var ipfs = require('ipfs-client'); | ||
ipfs.add(process.stdin, function(err, hash) { | ||
console.log(hash); | ||
}); | ||
``` | ||
3744
30