ipfs-api
Version:
A client library for the IPFS HTTP API
23 lines (18 loc) • 409 B
JavaScript
const promisify = require('promisify-es6')
const transform = function (res, callback) {
callback(null, res.Path)
}
module.exports = (send) => {
return promisify((args, opts, callback) => {
if (typeof (opts) === 'function') {
callback = opts
opts = {}
}
send.andTransform({
path: 'resolve',
args: args,
qs: opts
}, transform, callback)
})
}