ipfs
Version:
JavaScript implementation of the IPFS specification
32 lines (26 loc) • 611 B
JavaScript
const promisify = require('promisify-es6')
const pull = require('pull-stream')
module.exports = function (self) {
return promisify((ipfsPath, options, callback) => {
if (typeof options === 'function') {
callback = options
options = {}
}
options = options || {}
pull(
self.refsPullStream(ipfsPath, options),
pull.collect((err, values) => {
if (err) {
return callback(err)
}
callback(null, values)
})
)
})
}
// Preset format strings
module.exports.Format = {
default: '<dst>',
edges: '<src> -> <dst>'
}