diff options
-rwxr-xr-x | cli.js | 2 | ||||
-rw-r--r-- | lib/utils/exec.js | 6 | ||||
-rw-r--r-- | lib/utils/fetch.js | 8 | ||||
-rw-r--r-- | lib/utils/registry/request.js | 8 | ||||
-rwxr-xr-x | npm.js | 2 | ||||
-rw-r--r-- | package.json | 4 |
6 files changed, 15 insertions, 15 deletions
@@ -50,7 +50,7 @@ if (printVersion) { if (vindex !== -1) arglist.splice(vindex, 1) } else log(npm.version, "version") -process.addListener("uncaughtException", errorHandler) +process.on("uncaughtException", errorHandler) if (!command) { if (!printVersion) { // npm.commands.help([arglist.join(" ")]) diff --git a/lib/utils/exec.js b/lib/utils/exec.js index e963ddcdf..d4bb9ac2f 100644 --- a/lib/utils/exec.js +++ b/lib/utils/exec.js @@ -17,17 +17,17 @@ module.exports = function exec (cmd, args, env, pipe, cb) { ) , stdout = "" , stderr = "" - cp.stdout && cp.stdout.addListener("data", function (chunk) { + cp.stdout && cp.stdout.on("data", function (chunk) { if (chunk) { stdout += chunk } }); - cp.stdout && cp.stdout.addListener("data", function (chunk) { + cp.stdout && cp.stdout.on("data", function (chunk) { if (chunk) { stderr += chunk } }); - cp.addListener("exit", function (code) { + cp.on("exit", function (code) { if (code) cb(new Error("`"+cmd+"` failed with "+code)) else cb(null, code, stdout, stderr) }); diff --git a/lib/utils/fetch.js b/lib/utils/fetch.js index 3193fd252..c2b8a42ab 100644 --- a/lib/utils/fetch.js +++ b/lib/utils/fetch.js @@ -41,7 +41,7 @@ function fetchAndWrite (remote, fd, headers, maxRedirects, redirects, cb) { , (remote.pathname||"/")+(remote.search||"")+(remote.hash||"") , headers ) - .addListener("response", function (response) { + .on("response", function (response) { // handle redirects. var loc = get(response.headers, "location") if (Math.floor(response.statusCode / 100) === 3 @@ -66,7 +66,7 @@ function fetchAndWrite (remote, fd, headers, maxRedirects, redirects, cb) { , pct = 0 , lastPct = 0 log(len || "unknown", "content-length") - response.addListener("data", function (chunk) { + response.on("data", function (chunk) { // write the chunk... written += chunk.length if (len) { @@ -82,8 +82,8 @@ function fetchAndWrite (remote, fd, headers, maxRedirects, redirects, cb) { return cb(er) } }) - response.addListener("error", cb) - response.addListener("end", function () { + response.on("error", cb) + response.on("end", function () { log("finished", "fetch") log(written, "bytes") fs.close(fd, cb) diff --git a/lib/utils/registry/request.js b/lib/utils/registry/request.js index 40eb63554..5c0aa4665 100644 --- a/lib/utils/registry/request.js +++ b/lib/utils/registry/request.js @@ -55,12 +55,12 @@ function request (method, where, what, cb) { var client = http.createClient(u.port || (https ? 443 : 80), u.hostname, https) , request = client.request(method, u.pathname, headers) - request.addListener("response", function (response) { + request.on("response", function (response) { // if (response.statusCode !== 200) return cb(new Error( // "Status code " + response.statusCode + " from PUT "+where)) var data = "" - response.addListener("data", function (chunk) { data += chunk }) - response.addListener("end", function () { + response.on("data", function (chunk) { data += chunk }) + response.on("end", function () { var parsed try { parsed = JSON.parse(data) @@ -93,7 +93,7 @@ function request (method, where, what, cb) { return ( request.write(bytesRead === b.length ? b : b.slice(0, bytesRead)) ) ? W() - : request.addListener("drain", function DRAIN () { + : request.on("drain", function DRAIN () { request.removeListener("drain", DRAIN) W() }) @@ -90,4 +90,4 @@ Object.defineProperty(npm, "tmp", , enumerable:true }) -process.addListener("exit", function () { ini.save() }) +process.on("exit", function () { ini.save() }) diff --git a/package.json b/package.json index f352de2b5..ec854a696 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "npm" , "description" : "A package manager for node" -, "version" : "0.1.18" +, "version" : "0.1.18-1" , "author" : "Isaac Z. Schlueter <i@izs.me>" , "contributors" : [ "Steve Steiner <ssteinerX@gmail.com>" @@ -23,7 +23,7 @@ , "directories" : { "lib" : "./lib/" } , "main" : "./npm" , "bin" : { "npm" : "./cli.js" } -, "engines" : { "node" : ">=0.1.99" } +, "engines" : { "node" : ">=0.1.100" } , "scripts" : { "activate" : "node scripts/install-docs.js" , "deactivate" : "node scripts/install-docs.js" |