Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-07-20 13:58:40 +0400
committerisaacs <i@izs.me>2011-07-20 13:58:40 +0400
commit56341bbb72a6b27907654beda9d564c394f744d5 (patch)
tree0ab1650a6075a4bfbd6e29663f28230d5e3e64c1
parent586f9ef2f589a6a07fc197514c44d78b70a42fe0 (diff)
s/sys/util/g finally
-rwxr-xr-xbin/npm.js1
-rw-r--r--lib/utils/error-handler.js4
-rw-r--r--lib/utils/exec.js4
-rw-r--r--lib/utils/fetch.js4
-rw-r--r--lib/utils/ini-parser.js2
-rw-r--r--lib/utils/ini.js1
-rw-r--r--lib/utils/log.js6
-rw-r--r--lib/utils/output.js4
-rw-r--r--lib/utils/proto-list.js8
-rw-r--r--lib/utils/sys.js2
-rw-r--r--lib/view.js4
-rw-r--r--test/common.js2
12 files changed, 18 insertions, 24 deletions
diff --git a/bin/npm.js b/bin/npm.js
index a6c9808d0..90e853325 100755
--- a/bin/npm.js
+++ b/bin/npm.js
@@ -6,7 +6,6 @@ log.info("ok", "it worked if it ends with")
var fs = require("graceful-fs")
, path = require("path")
- , sys = require("../lib/utils/sys")
, npm = require("../npm")
, ini = require("../lib/utils/ini")
, rm = require("../lib/utils/rm-rf")
diff --git a/lib/utils/error-handler.js b/lib/utils/error-handler.js
index f6bc3e9e1..8aea990fb 100644
--- a/lib/utils/error-handler.js
+++ b/lib/utils/error-handler.js
@@ -178,7 +178,7 @@ function exit (code) {
function writeLogFile (cb) {
var fs = require("graceful-fs")
, fstr = fs.createWriteStream("npm-debug.log")
- , sys = require("util")
+ , util = require("util")
log.history.forEach(function (m) {
var lvl = log.LEVEL[m.level]
@@ -186,7 +186,7 @@ function writeLogFile (cb) {
, b = lvl + pref + " "
, msg = typeof m.msg === "string" ? m.msg
: msg instanceof Error ? msg.stack || msg.message
- : sys.inspect(m.msg, 0, 4)
+ : util.inspect(m.msg, 0, 4)
fstr.write(new Buffer(b
+(msg.split(/\n+/).join("\n"+b))
+ "\n"))
diff --git a/lib/utils/exec.js b/lib/utils/exec.js
index de70ee731..607665f33 100644
--- a/lib/utils/exec.js
+++ b/lib/utils/exec.js
@@ -5,7 +5,7 @@ exec.pipe = pipe
var log = require("./log")
, child_process = require("child_process")
- , sys = require("./sys")
+ , util = require("util")
, npm = require("../../npm")
, myUID = process.getuid ? process.getuid() : null
, myGID = process.getgid ? process.getgid() : null
@@ -58,7 +58,7 @@ function exec (cmd, args, env, takeOver, cwd, uid, gid, cb) {
function logger (d) { if (d) process.binding("stdio").writeError(d+"") }
function pipe (cp1, cp2, cb) {
- sys.pump(cp1.stdout, cp2.stdin)
+ util.pump(cp1.stdout, cp2.stdin)
var errState = null
, buff1 = ""
, buff2 = ""
diff --git a/lib/utils/fetch.js b/lib/utils/fetch.js
index 60beee02b..8168fa840 100644
--- a/lib/utils/fetch.js
+++ b/lib/utils/fetch.js
@@ -5,7 +5,7 @@
var http
, https
, url = require("url")
- , sys = require("./sys")
+ , util = require("util")
, fs = require("graceful-fs")
, get = require("./get")
, set = require("./set")
@@ -106,7 +106,7 @@ function fetchAndWrite (remote, fstr, headers, maxRedirects, redirects) {
if (response.statusCode !== 200) {
return fstr.emit("error", new Error(response.statusCode + " " +
- (sys.inspect(response.headers))))
+ (util.inspect(response.headers))))
}
// this is the one we want.
diff --git a/lib/utils/ini-parser.js b/lib/utils/ini-parser.js
index 8c08b6b85..df4c21fbc 100644
--- a/lib/utils/ini-parser.js
+++ b/lib/utils/ini-parser.js
@@ -1,5 +1,3 @@
-var sys = require("./sys")
-
exports.parse = function parse (d) {
var ini = {'-':{}}
, section = '-'
diff --git a/lib/utils/ini.js b/lib/utils/ini.js
index d8b8d097f..5a59fd9f2 100644
--- a/lib/utils/ini.js
+++ b/lib/utils/ini.js
@@ -30,7 +30,6 @@ Object.defineProperty(exports, "keys",
var fs = require("graceful-fs")
, path = require("path")
- , sys = require("./sys")
, privateKey = null
, log = require("./log")
diff --git a/lib/utils/log.js b/lib/utils/log.js
index 10a6495f3..11e5839c5 100644
--- a/lib/utils/log.js
+++ b/lib/utils/log.js
@@ -72,7 +72,7 @@ log.waitForConfig = function () { waitForConfig = true }
// now the required stuff has been loaded,
// so the transitive module dep will work
-var sys = require("./sys")
+var util = require("util")
, npm = require("../../npm")
, net = require("net")
@@ -83,7 +83,7 @@ Object.defineProperty(log, "level",
show = show.split(",")[0]
if (!isNaN(show)) show = +show
else if (!LEVEL.hasOwnProperty(show)) {
- sys.error("Invalid loglevel config: "+JSON.stringify(show))
+ util.error("Invalid loglevel config: "+JSON.stringify(show))
show = "info"
}
if (isNaN(show)) show = LEVEL[show]
@@ -147,7 +147,7 @@ npm.on("log", function (logData) {
}
if (!isFinite(level) || level < show) return cb()
if (typeof msg !== "string" && !(msg instanceof Error)) {
- msg = sys.inspect(msg, 0, 4, true)
+ msg = util.inspect(msg, 0, 4, true)
}
// console.error("level, showlevel, show", level, show, (level >= show))
diff --git a/lib/utils/output.js b/lib/utils/output.js
index f99beb914..8b54d1181 100644
--- a/lib/utils/output.js
+++ b/lib/utils/output.js
@@ -9,7 +9,7 @@ var npm = require("../../npm")
, streams = {}
, ttys = {}
, net = require("net")
- , sys = require("./sys")
+ , util = require("util")
function doColor (stream) {
var conf = npm.config.get("color")
@@ -43,7 +43,7 @@ function write (args, stream, lf, cb) {
, colored = doColor(stream)
msg = args.map(function (arg) {
if (typeof arg !== "string") {
- return sys.inspect(arg, false, 5, colored) + "\n"
+ return util.inspect(arg, false, 5, colored) + "\n"
} else {
if (!colored) arg = arg.replace(/\033\[[0-9;]*m/g, '')
return arg
diff --git a/lib/utils/proto-list.js b/lib/utils/proto-list.js
index a9d1b8a77..02a18c56c 100644
--- a/lib/utils/proto-list.js
+++ b/lib/utils/proto-list.js
@@ -60,9 +60,9 @@ ProtoList.prototype =
if (module === require.main) {
var assert = require("assert")
- , sys = require("./sys")
+ , util = require("util")
-sys.debug("testing")
+util.debug("testing")
var p = new ProtoList
p.push({foo:"bar"})
p.push({})
@@ -88,5 +88,5 @@ assert.equal(p.get("foo"), undefined)
-sys.debug("ok")
-} \ No newline at end of file
+util.debug("ok")
+}
diff --git a/lib/utils/sys.js b/lib/utils/sys.js
deleted file mode 100644
index 3b56ca336..000000000
--- a/lib/utils/sys.js
+++ /dev/null
@@ -1,2 +0,0 @@
-
-module.exports = require(!!process.binding("natives").util ? "util" : "sys")
diff --git a/lib/view.js b/lib/view.js
index 46340c6b7..842888bbe 100644
--- a/lib/view.js
+++ b/lib/view.js
@@ -42,7 +42,7 @@ view.completion = function (opts, cb) {
var registry = require("./utils/npm-registry-client")
, ini = require("./utils/ini-parser")
, log = require("./utils/log")
- , sys = require("./utils/sys")
+ , util = require("util")
, output
, npm = require("../npm")
, semver = require("semver")
@@ -167,7 +167,7 @@ function printData (data, cb) {
fields.forEach(function (f) {
var d = cleanup(data[v][f])
if (showVersions || showFields || typeof d !== "string") {
- d = sys.inspect(cleanup(data[v][f]), false, 5, true)
+ d = util.inspect(cleanup(data[v][f]), false, 5, true)
}
if (f && showFields) f += " = "
if (d.indexOf("\n") !== -1) f += "\n"
diff --git a/test/common.js b/test/common.js
index abbfef915..2755056b1 100644
--- a/test/common.js
+++ b/test/common.js
@@ -1,6 +1,6 @@
// whatever, it's just tests.
-;["sys","assert"].forEach(function (thing) {
+;["util","assert"].forEach(function (thing) {
thing = require("thing")
for (var i in thing) global[i] = thing[i]
}