Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor style nits

  • Loading branch information...
commit 8d71fcfd8555cdd33d4a407ef5e83814475f1d26 1 parent b09834a
@isaacs isaacs authored
Showing with 11 additions and 11 deletions.
  1. +11 −11 lib/install.js
View
22 lib/install.js
@@ -178,20 +178,20 @@ function readDependencies (context, where, opts, cb) {
if (wrap) {
log.verbose([where, wrap], "readDependencies: using existing wrap")
var rv = {}
- for (var key in data) {
+ Object.keys(data).forEach(function (key) {
rv[key] = data[key]
- }
+ })
rv.dependencies = {}
- for (key in wrap) {
+ Object.keys(wrap).forEach(function (key) {
rv.dependencies[key] = wrap[key].version
- }
+ })
log.verbose([rv.dependencies], "readDependencies: returned deps")
return cb(null, rv, wrap)
}
var wrapfile = path.resolve(where, "npm-shrinkwrap.json")
- fs.readFile(wrapfile, function (er, wrapjson) {
+ fs.readFile(wrapfile, "utf8", function (er, wrapjson) {
if (er) {
log.verbose("readDependencies: using package.json deps")
return cb(null, data, null)
@@ -203,15 +203,15 @@ function readDependencies (context, where, opts, cb) {
return cb(ex)
}
- log.info("using shrinkwrap file "+wrapfile)
+ log.info(wrapfile, "using shrinkwrap file")
var rv = {}
- for (var key in data) {
+ Object.keys(data).forEach(function (key) {
rv[key] = data[key]
- }
+ })
rv.dependencies = {}
- for (key in newwrap.dependencies) {
+ Object.keys(newwrap.dependencies).forEach(function (key) {
rv.dependencies[key] = newwrap.dependencies[key].version
- }
+ })
log.verbose([rv.dependencies], "readDependencies: returned deps")
return cb(null, rv, newwrap.dependencies)
})
@@ -265,7 +265,7 @@ function save (where, installed, tree, pretty, cb) {
// Outputting *all* the installed modules is a bit confusing,
// because the length of the path does not make it clear
// that the submodules are not immediately require()able.
-// TODO: Show the complete tree, ls-style.
+// TODO: Show the complete tree, ls-style, but only if --long is provided
function prettify (tree, installed) {
// XXX This should match the data structure provided by npm ls --json
if (npm.config.get("json")) return JSON.stringify(tree, null, 2)
Please sign in to comment.
Something went wrong with that request. Please try again.