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:
authorRobert Kowalski <rok@kowalski.gd>2015-04-12 00:22:15 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-04-13 03:08:35 +0300
commitd90d0b992acbf62fd5d68debf9d1dbd6cfa20804 (patch)
tree3dc65a4b871a3fcd6471973b0e706b3d2dab1c58
parent65bf7cffaf91c426b676c47529eee796f8b8b75c (diff)
remove child-process-close
npm doesn't support Node 0.6 any more.
-rw-r--r--lib/npm.js3
-rw-r--r--node_modules/child-process-close/README.md45
-rw-r--r--node_modules/child-process-close/index.js48
-rw-r--r--node_modules/child-process-close/package.json37
-rw-r--r--node_modules/child-process-close/test/test-exec.js50
-rw-r--r--node_modules/child-process-close/test/test-fork.js41
-rw-r--r--node_modules/child-process-close/test/test-spawn-and-execfile.js73
-rw-r--r--node_modules/child-process-close/test/test.js41
-rw-r--r--node_modules/child-process-close/test/worker-fork.js3
-rw-r--r--node_modules/child-process-close/test/worker-spawn.js5
-rw-r--r--package.json2
11 files changed, 0 insertions, 348 deletions
diff --git a/lib/npm.js b/lib/npm.js
index 459a3c324..a2756ed7d 100644
--- a/lib/npm.js
+++ b/lib/npm.js
@@ -11,9 +11,6 @@ if (typeof WScript !== "undefined") {
}
-// monkey-patch support for 0.6 child processes
-require('child-process-close')
-
var EventEmitter = require("events").EventEmitter
, npm = module.exports = new EventEmitter()
, npmconf = require("./config/core.js")
diff --git a/node_modules/child-process-close/README.md b/node_modules/child-process-close/README.md
deleted file mode 100644
index ac6c1840f..000000000
--- a/node_modules/child-process-close/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-# child-process-close
-
-This module makes child process objects, (created with `spawn`, `fork`, `exec`
-or `execFile`) emit the `close` event in node v0.6 like they do in node v0.8.
-This makes it easier to write code that works correctly on both version of
-node.
-
-
-## Usage
-
-Just make sure to `require('child-process-close')` anywhere. It will patch the `child_process` module.
-
-```js
-require('child-process-close');
-var spawn = require('child_process').spawn;
-
-var cp = spawn('foo');
-cp.on('close', function(exitCode, signal) {
- // This now works on all node versions.
-});
-```
-
-
-## License
-
-Copyright (C) 2012 Bert Belder
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/child-process-close/index.js b/node_modules/child-process-close/index.js
deleted file mode 100644
index 562516a32..000000000
--- a/node_modules/child-process-close/index.js
+++ /dev/null
@@ -1,48 +0,0 @@
-
-var child_process = require('child_process');
-
-// Re-export the child_process module.
-module.exports = child_process;
-
-// Only node versions up to v0.7.6 need this hook.
-if (!/^v0\.([0-6]\.|7\.[0-6](\D|$))/.test(process.version))
- return;
-
-// Do not add the hook if already hooked.
-if (child_process.hasOwnProperty('_exit_hook'))
- return;
-
-// Version the hook in case there is ever the need to release a 0.2.0.
-child_process._exit_hook = 1;
-
-
-function hook(name) {
- var orig = child_process[name];
-
- // Older node versions may not have all functions, e.g. fork().
- if (!orig)
- return;
-
- // Store the unhooked version.
- child_process['_original_' + name] = orig;
-
- // Do the actual hooking.
- child_process[name] = function() {
- var child = orig.apply(this, arguments);
-
- child.once('exit', function(code, signal) {
- process.nextTick(function() {
- child.emit('close', code, signal);
- });
- });
-
- return child;
- }
-}
-
-hook('spawn');
-hook('fork');
-hook('execFile');
-
-// Don't hook 'exec': it calls `exports.execFile` internally, so hooking it
-// would trigger the close event twice.
diff --git a/node_modules/child-process-close/package.json b/node_modules/child-process-close/package.json
deleted file mode 100644
index 23b19e010..000000000
--- a/node_modules/child-process-close/package.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "child-process-close",
- "version": "0.1.1",
- "description": "Make child_process objects emit 'close' events in node v0.6 like they do in v0.8. This makes it easier to write code that works correctly on both version of node.",
- "main": "index.js",
- "scripts": {
- "test": "node test/test.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/piscisaureus/child-process-close.git"
- },
- "keywords": [
- "child_process",
- "spawn",
- "fork",
- "exec",
- "execFile",
- "close",
- "exit"
- ],
- "author": {
- "name": "Bert Belder"
- },
- "license": "MIT",
- "readme": "\n# child-process-close\n\nThis module makes child process objects, (created with `spawn`, `fork`, `exec`\nor `execFile`) emit the `close` event in node v0.6 like they do in node v0.8.\nThis makes it easier to write code that works correctly on both version of\nnode.\n\n\n## Usage\n\nJust make sure to `require('child-process-close')` anywhere. It will patch the `child_process` module.\n\n```js\nrequire('child-process-close');\nvar spawn = require('child_process').spawn;\n\nvar cp = spawn('foo');\ncp.on('close', function(exitCode, signal) {\n // This now works on all node versions.\n});\n```\n\n\n## License\n\nCopyright (C) 2012 Bert Belder\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/piscisaureus/child-process-close/issues"
- },
- "_id": "child-process-close@0.1.1",
- "dist": {
- "shasum": "c1909c6c3bbcea623e3bd74493ddb1c94c47c500"
- },
- "_from": "child-process-close@",
- "_resolved": "https://registry.npmjs.org/child-process-close/-/child-process-close-0.1.1.tgz"
-}
diff --git a/node_modules/child-process-close/test/test-exec.js b/node_modules/child-process-close/test/test-exec.js
deleted file mode 100644
index 5072d0295..000000000
--- a/node_modules/child-process-close/test/test-exec.js
+++ /dev/null
@@ -1,50 +0,0 @@
-
-require('../index');
-
-var assert = require('assert'),
- exec = require('child_process').exec;
-
-var cp = exec('echo hello', function(err) {
- assert(!err);
-});
-
-var stdoutData = '',
- stdoutEnd = false,
- gotExit = false,
- gotClose = false;
-
-cp.stdout.setEncoding('ascii');
-
-cp.stdout.on('data', function(data) {
- assert(!stdoutEnd);
- stdoutData += data;
-});
-
-cp.stdout.on('end', function() {
- assert(!stdoutEnd);
- assert(/^hello/.test(stdoutData));
- stdoutEnd = true;
-});
-
-cp.on('exit', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(!gotExit);
- assert(!gotClose);
- gotExit = true;
-});
-
-cp.on('close', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(gotExit);
- assert(stdoutEnd);
- assert(!gotClose);
- gotClose = true;
-});
-
-process.on('exit', function() {
- assert(stdoutEnd);
- assert(gotExit);
- assert(gotClose);
-});
diff --git a/node_modules/child-process-close/test/test-fork.js b/node_modules/child-process-close/test/test-fork.js
deleted file mode 100644
index 9743c028e..000000000
--- a/node_modules/child-process-close/test/test-fork.js
+++ /dev/null
@@ -1,41 +0,0 @@
-
-require('../index');
-
-var assert = require('assert'),
- fork = require('child_process').fork;
-
-var cp = fork('worker-fork');
-
-var gotMessage = false,
- gotExit = false,
- gotClose = false;
-
-cp.on('message', function(msg) {
- assert.strictEqual(msg, 'hello');
- assert(!gotMessage);
- assert(!gotClose);
- gotMessage = true;
-});
-
-cp.on('exit', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(!gotExit);
- assert(!gotClose);
- gotExit = true;
-});
-
-cp.on('close', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(gotExit);
- assert(gotMessage);
- assert(!gotClose);
- gotClose = true;
-});
-
-process.on('exit', function() {
- assert(gotMessage);
- assert(gotExit);
- assert(gotClose);
-});
diff --git a/node_modules/child-process-close/test/test-spawn-and-execfile.js b/node_modules/child-process-close/test/test-spawn-and-execfile.js
deleted file mode 100644
index 82f9fa978..000000000
--- a/node_modules/child-process-close/test/test-spawn-and-execfile.js
+++ /dev/null
@@ -1,73 +0,0 @@
-
-require('../index');
-
-var assert = require('assert'),
- spawn = require('child_process').spawn;
- execFile = require('child_process').execFile;
-
-
-var cp1 = spawn(process.execPath, ['worker-spawn']);
-check(cp1);
-
-var cp2 = execFile(process.execPath, ['worker-spawn'], function(err) {
- assert(!err);
-});
-check(cp2);
-
-
-function check(cp) {
- var gotExit = false,
- gotClose = false,
- stdoutData = '',
- stdoutEnd = false,
- stderrData = '',
- stderrEnd = false;
-
- cp.stdout.setEncoding('ascii');
-
- cp.stdout.on('data', function(data) {
- assert(!stdoutEnd);
- stdoutData += data;
- });
-
- cp.stdout.on('end', function(data) {
- assert(!stdoutEnd)
- assert.strictEqual(stdoutData.length, 100000);
- stdoutEnd = true;
- });
-
- cp.stderr.setEncoding('ascii');
-
- cp.stderr.on('data', function(data) {
- stderrData += data;
- });
-
- cp.stderr.on('end', function(data) {
- assert(!stderrEnd)
- assert.strictEqual(stderrData.length, 100000);
- stderrEnd = true;
- });
-
- cp.on('exit', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(!gotExit);
- assert(!gotClose);
- gotExit = true;
- });
-
- cp.on('close', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(!cp.stdout || stdoutEnd);
- assert(!cp.stderr || stderrEnd);
- assert(gotExit);
- assert(!gotClose);
- gotClose = true;
- });
-
- process.on('exit', function() {
- assert(gotExit);
- assert(gotClose);
- });
-}
diff --git a/node_modules/child-process-close/test/test.js b/node_modules/child-process-close/test/test.js
deleted file mode 100644
index 99047452d..000000000
--- a/node_modules/child-process-close/test/test.js
+++ /dev/null
@@ -1,41 +0,0 @@
-
-var TESTS = [
- 'test-spawn-and-execfile',
- 'test-fork',
- 'test-exec',
-];
-
-var execFile = require('child_process').execFile;
-var passed = 0, failed = 0;
-
-function next() {
- var test = TESTS.shift();
- if (!test)
- done();
-
- console.log("Running test: %s", test);
- execFile(process.execPath, [test], { cwd: __dirname }, onExit);
-}
-
-function onExit(err, stdout, stderr) {
- if (err) {
- console.log("... failed:\n%s%s\n", stdout, stderr);
- failed++;
- } else {
- console.log("... pass");
- passed++;
- }
-
- next();
-}
-
-function done() {
- console.log("Tests run: %d. Passed: %d. Failed: %d",
- passed + failed,
- passed,
- failed);
-
- process.exit(+(failed > 0));
-}
-
-next();
diff --git a/node_modules/child-process-close/test/worker-fork.js b/node_modules/child-process-close/test/worker-fork.js
deleted file mode 100644
index 56e83ce80..000000000
--- a/node_modules/child-process-close/test/worker-fork.js
+++ /dev/null
@@ -1,3 +0,0 @@
-
-process.send('hello');
-process.exit(0);
diff --git a/node_modules/child-process-close/test/worker-spawn.js b/node_modules/child-process-close/test/worker-spawn.js
deleted file mode 100644
index f45d89819..000000000
--- a/node_modules/child-process-close/test/worker-spawn.js
+++ /dev/null
@@ -1,5 +0,0 @@
-
-var out = new Array(100000).join('x');
-
-console.log(out);
-console.error(out);
diff --git a/package.json b/package.json
index eab43a627..13f938b1b 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,6 @@
"async-some": "~1.0.1",
"block-stream": "0.0.7",
"char-spinner": "~1.0.1",
- "child-process-close": "~0.1.1",
"chmodr": "~0.1.0",
"chownr": "0",
"cmd-shim": "~2.0.1",
@@ -110,7 +109,6 @@
"async-some",
"block-stream",
"char-spinner",
- "child-process-close",
"chmodr",
"chownr",
"cmd-shim",