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>2010-07-03 12:07:26 +0400
committerisaacs <i@izs.me>2010-07-03 12:07:26 +0400
commitf97b8136ebf6fe88d8e2883bc7bdb7800dda3cd2 (patch)
treeaf7c1ae46137afa24ffabe22fb9a6917b1c874c1
parent90c9ec8ef92b7fc0c173515ebe1afccd3d19d665 (diff)
s/addListener/on/g
-rwxr-xr-xcli.js2
-rw-r--r--lib/utils/exec.js6
-rw-r--r--lib/utils/fetch.js8
-rw-r--r--lib/utils/registry/request.js8
-rwxr-xr-xnpm.js2
-rw-r--r--package.json4
6 files changed, 15 insertions, 15 deletions
diff --git a/cli.js b/cli.js
index a5ed1d4d1..879017620 100755
--- a/cli.js
+++ b/cli.js
@@ -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()
})
diff --git a/npm.js b/npm.js
index a90e2b90b..0d32fef2f 100755
--- a/npm.js
+++ b/npm.js
@@ -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"