diff --git a/src/add-to-dagnode-transform.js b/src/add-to-dagnode-transform.js index 55e6c90eb..32de7f698 100644 --- a/src/add-to-dagnode-transform.js +++ b/src/add-to-dagnode-transform.js @@ -1,6 +1,6 @@ 'use strict' -const async = require('async') +const map = require('async/map') const getDagNode = require('./get-dagnode') // transform { Hash: '...' } objects into { path: 'string', node: DAGNode } @@ -9,7 +9,7 @@ module.exports = function (err, res, send, done) { return done(err) } - async.map(res, function map (entry, next) { + map(res, function map (entry, next) { getDagNode(send, entry.Hash, function (err, node) { if (err) { return next(err) diff --git a/src/get-dagnode.js b/src/get-dagnode.js index 3d60844c9..9a7350810 100644 --- a/src/get-dagnode.js +++ b/src/get-dagnode.js @@ -2,12 +2,12 @@ const DAGNode = require('ipfs-merkle-dag').DAGNode const bl = require('bl') -const async = require('async') +const parallel = require('async/parallel') module.exports = function (send, hash, cb) { // Retrieve the object and its data in parallel, then produce a DAGNode // instance using this information. - async.parallel([ + parallel([ function get (done) { send('object/get', hash, null, null, done) },