deps/npm/lib/build.js
function build (args, cb) {
  readAll(args, function (er, args) {
    if (er) return cb(er)
    // do all preinstalls, then check deps, then install all, then finish up.
    chain
      ( [asyncMap, args, function (a, cb) {
          return lifecycle(a, "preinstall", cb)
        }]
      , [asyncMap, args, function (a, cb) {
          return resolveDependencies(a, cb)
        }]
      , [ asyncMap
        , args
        , function (pkg, cb) {
            linkModules(pkg, path.join(npm.root, pkg.name+"@"+pkg.version), cb)
          }
        , linkBins
        , linkMans
        ]
      // must rebuild bundles serially, because it messes with configs.
      , [chain].concat(args.map(function (a) { return [rebuildBundle, a] }))
      , [linkDependencies, args]
      , [finishBuild, args]
      , cb
      )
  })
}
function build (args, cb) {
  readAll(args, function (er, args) {
    if (er) return cb(er)
    // do all preinstalls, then check deps, then install all, then finish up.
    chain
      ( [asyncMap, args, function (a, cb) {
          return lifecycle(a, "preinstall", cb)
        }]
      , [asyncMap, args, function (a, cb) {
          return resolveDependencies(a, cb)
        }]
      , [ asyncMap
        , args
        , function (pkg, cb) {
            linkModules(pkg, path.join(npm.root, pkg.name+"@"+pkg.version), cb)
          }
        , linkBins
        , linkMans
        ]
      // must rebuild bundles serially, because it messes with configs.
      , [chain].concat(args.map(function (a) { return [rebuildBundle, a] }))
      , [linkDependencies, args]
      , [finishBuild, args]
      , cb
      )
  })
}
function build ( args , cb ) { readAll ( args , function ( er , args ) { if ( er ) return cb ( er ) // do all preinstalls, then check deps, then install all, then finish up. chain ( [ asyncMap , args , function ( a , cb ) { return lifecycle ( a , "preinstall" , cb ) } ] , [ asyncMap , args , function ( a , cb ) { return resolveDependencies ( a , cb ) } ] , [ asyncMap , args , function ( pkg , cb ) { linkModules ( pkg , path . join ( npm . root , pkg . name + "@" + pkg . version ) , cb ) } , linkBins , linkMans ] // must rebuild bundles serially, because it messes with configs. , [ chain ] . concat ( args . map ( function ( a ) { return [ rebuildBundle , a ] } ) ) , [ linkDependencies , args ] , [ finishBuild , args ] , cb ) } ) }
pkg is either a "package" folder, or a package.json data obj, or an object that has the package.json data on the _data member.
pkg is either a package folder or a package . json data obj or an object that has the package . json data on the _data member .