Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

s/sys/util/g finally

  • Loading branch information...
commit 56341bbb72a6b27907654beda9d564c394f744d5 1 parent 586f9ef
@isaacs isaacs authored
View
1  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")
View
4 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"))
View
4 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 = ""
View
4 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.
View
2  lib/utils/ini-parser.js
@@ -1,5 +1,3 @@
-var sys = require("./sys")
-
exports.parse = function parse (d) {
var ini = {'-':{}}
, section = '-'
View
1  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")
View
6 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))
View
4 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
View
8 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")
-}
+util.debug("ok")
+}
View
2  lib/utils/sys.js
@@ -1,2 +0,0 @@
-
-module.exports = require(!!process.binding("natives").util ? "util" : "sys")
View
4 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"
View
2  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]
}
Please sign in to comment.
Something went wrong with that request. Please try again.