Comparing version 1.0.2 to 1.1.0
33
index.js
@@ -52,2 +52,3 @@ var fs = require('fs'); | ||
var chunkedObjects = !!res.headers['x-chunked-output']; | ||
if(chunkedObjects && buffer) return cb(null, res); | ||
@@ -96,2 +97,4 @@ var data = ''; | ||
} | ||
return req; | ||
} | ||
@@ -134,3 +137,3 @@ | ||
return function(cb) { | ||
send(name, null, null, null, cb); | ||
return send(name, null, null, null, cb); | ||
} | ||
@@ -141,3 +144,3 @@ } | ||
return function(arg, cb) { | ||
send(name, arg, null, null, cb); | ||
return send(name, arg, null, null, cb); | ||
} | ||
@@ -150,3 +153,3 @@ } | ||
add: function(file, cb) { | ||
send('add', null, null, file, cb); | ||
return send('add', null, null, file, cb); | ||
}, | ||
@@ -159,9 +162,9 @@ cat: argCommand('cat'), | ||
set: function(key, value, cb) { | ||
send('config', [key, value], null, null, cb) | ||
return send('config', [key, value], null, null, cb) | ||
}, | ||
show: function(cb) { | ||
send('config/show', null, null, null, true, cb); | ||
return send('config/show', null, null, null, true, cb); | ||
}, | ||
replace: function(file, cb) { | ||
send('config/replace', null, null, file, cb) | ||
return send('config/replace', null, null, file, cb) | ||
} | ||
@@ -189,3 +192,3 @@ }, | ||
if(ipns) opts.n = ipns; | ||
send('mount', null, opts, null, cb); | ||
return send('mount', null, opts, null, cb); | ||
}, | ||
@@ -202,3 +205,3 @@ | ||
return cb(null, new Error('block.put() only accepts 1 file')); | ||
send('block/put', null, null, file, cb); | ||
return send('block/put', null, null, file, cb); | ||
}, | ||
@@ -212,3 +215,3 @@ }, | ||
return cb(null, new Error('Must specify an object encoding ("json" or "protobuf")')) | ||
send('block/put', encoding, null, file, cb); | ||
return send('block/put', encoding, null, file, cb); | ||
}, | ||
@@ -224,3 +227,3 @@ data: argCommand('object/data'), | ||
ping: function(id, cb) { | ||
send('ping', id, { n: 1 }, null, function(err, res) { | ||
return send('ping', id, { n: 1 }, null, function(err, res) { | ||
if(err) return cb(err, null); | ||
@@ -236,3 +239,3 @@ cb(null, res[1]); | ||
} | ||
send('id', id, null, null, cb); | ||
return send('id', id, null, null, cb); | ||
}, | ||
@@ -249,3 +252,3 @@ pin: { | ||
if(type) opts = { type: type } | ||
send('pin/ls', null, opts, null, cb); | ||
return send('pin/ls', null, opts, null, cb); | ||
}, | ||
@@ -257,2 +260,8 @@ }, | ||
disable: command('gateway/disable') | ||
}, | ||
log: { | ||
tail: function(cb) { | ||
return send('log/tail', null, {enc: 'text'}, null, true, cb); | ||
} | ||
} | ||
@@ -259,0 +268,0 @@ } |
{ | ||
"name": "ipfs-api", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "An client library for the IPFS API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6919
227