ipfs-http-client
Version:
A client library for the IPFS HTTP API
21 lines (16 loc) • 587 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var configure = require('../lib/configure.js');
var toUrlSearchParams = require('../lib/to-url-search-params.js');
const createExport = configure.configure(api => {
async function* dagExport(root, options = {}) {
const res = await api.post('dag/export', {
signal: options.signal,
searchParams: toUrlSearchParams.toUrlSearchParams({ arg: root.toString() }),
headers: options.headers
});
yield* res.iterator();
}
return dagExport;
});
exports.createExport = createExport;