Comparing version 0.0.4 to 0.0.6
30
index.js
@@ -1,5 +0,2 @@ | ||
var net = require('net'); | ||
var fs = require('fs'); | ||
var stream = require('stream'); | ||
var assert = require('assert'); | ||
var http = require('http'); | ||
@@ -42,3 +39,4 @@ var Multipart = require('multipart-stream'); | ||
'Content-Type': contentType | ||
} | ||
}, | ||
withCredentials: false | ||
}, function(res) { | ||
@@ -55,3 +53,4 @@ var data = ''; | ||
if(res.statusCode >= 400) { | ||
if(res.statusCode >= 400 || !res.statusCode) { | ||
if(!data) data = new Error; | ||
return cb(data, null); | ||
@@ -186,3 +185,22 @@ } | ||
}, | ||
id: command('id') | ||
id: function(id, cb) { | ||
if(typeof id === 'function') { | ||
cb = id; | ||
id = null; | ||
} | ||
send('id', id, null, null, cb); | ||
}, | ||
pin: { | ||
add: argCommand('pin/add'), | ||
remove: argCommand('pin/rm'), | ||
list: function(type, cb) { | ||
if(typeof type === 'function') { | ||
cb = type; | ||
type = null; | ||
} | ||
var opts = null; | ||
if(type) opts = { type: type } | ||
send('pin/ls', null, opts, null, cb); | ||
}, | ||
} | ||
} | ||
@@ -189,0 +207,0 @@ } |
{ | ||
"name": "ipfs-api", | ||
"version": "0.0.4", | ||
"version": "0.0.6", | ||
"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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
5555
185
1