Comparing version 2.0.2 to 3.0.0
@@ -0,1 +1,7 @@ | ||
3.0.0 / 2016-09-11 | ||
------------------ | ||
- port to NaN [#31] | ||
- change JS style to Standard | ||
- dropped official support for Node v0.10 | ||
2.0.2 / 2015-11-27 | ||
@@ -2,0 +8,0 @@ ------------------ |
var kexec = require('../') | ||
kexec('top'); | ||
kexec('top') |
var kexec = require('../') | ||
console.log(process.pid+' - PID before exec') | ||
console.log(process.pid + ' - PID before exec') | ||
kexec('sh', [ '-c', 'echo "$$ - PID after exec"' ] ); | ||
kexec('sh', [ '-c', 'echo "$$ - PID after exec"' ]) |
var kexec = require('../') | ||
kexec('less', [ '/etc/fstab' ] ); | ||
kexec('less', [ '/etc/fstab' ]) |
10
index.js
@@ -1,9 +0,1 @@ | ||
var kexec = null; | ||
/*try { | ||
kexec = require("./build/default/kexec.node"); | ||
} catch(e) {*/ | ||
kexec = require("./build/Release/kexec.node"); | ||
//} | ||
module.exports = kexec.kexec; //function of kexec module is named kexec | ||
module.exports = require('./build/Release/kexec.node').kexec |
{ | ||
"name": "kexec", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "Replace your Node.js process with another process. Like Ruby exec.", | ||
@@ -10,2 +10,7 @@ "homepage": "https://github.com/jprichardson/node-kexec", | ||
}, | ||
"scripts": { | ||
"lint": "standard", | ||
"test": "npm run lint && npm run unit", | ||
"unit": "mocha" | ||
}, | ||
"keywords": [ | ||
@@ -24,4 +29,8 @@ "exec", | ||
"devDependencies": { | ||
"mocha": "^2.3.3" | ||
"mocha": "^2.3.3", | ||
"standard": "^8.0.0" | ||
}, | ||
"dependencies": { | ||
"nan": "^2.4.0" | ||
} | ||
} |
Node.js - kexec | ||
=============== | ||
[![npm Package](https://img.shields.io/npm/v/kexec.svg?style=flat-square)](https://www.npmjs.org/package/kexec) | ||
[![build status](https://api.travis-ci.org/jprichardson/node-kexec.svg)](http://travis-ci.org/jprichardson/node-kexec) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) | ||
This module causes your current Node.js process to be replaced by the process invoked by the parameter of this function. It's like the Ruby exec function. It currently does not work on Windows. | ||
@@ -12,12 +16,12 @@ | ||
```javascript | ||
var kexec = require('kexec'); | ||
```js | ||
var kexec = require('kexec') | ||
kexec('top'); //your process now becomes top, can also accept parameters in one string | ||
kexec('top') //your process now becomes top, can also accept parameters in one string | ||
``` | ||
```javascript | ||
var kexec = require('kexec'); | ||
var kexec = require('kexec') | ||
kexec('du', [ '-sh', '/etc/fstab' ]); //your process now becomes du, with the arguments indicated | ||
kexec('du', [ '-sh', '/etc/fstab' ]) //your process now becomes du, with the arguments indicated | ||
``` | ||
@@ -52,4 +56,1 @@ | ||
Copyright (c) 2011-2015 JP Richardson | ||
var exec = require('child_process').exec | ||
, path = require('path') | ||
, assert = require('assert'); | ||
var path = require('path') | ||
var assert = require('assert') | ||
/* global suite, test */ | ||
suite('kexec') | ||
test('+ kexec() - kexec echo - single argument', function(done) { | ||
var echoFile = path.join(__dirname, './files/echo.sh'); | ||
test('+ kexec() - kexec echo - single argument', function (done) { | ||
var echoFile = path.join(__dirname, './files/echo.sh') | ||
exec(echoFile, function(error, stdout, stderr) { | ||
assert(stdout.trim() === 'hello world'); | ||
assert(stderr.trim() === ''); | ||
assert( error === null ); | ||
done(); | ||
}); | ||
exec(echoFile, function (error, stdout, stderr) { | ||
assert(stdout.trim() === 'hello world') | ||
assert(stderr.trim() === '') | ||
assert(error === null) | ||
done() | ||
}) | ||
}) | ||
var exec = require('child_process').exec | ||
, path = require('path') | ||
, assert = require('assert'); | ||
var path = require('path') | ||
var assert = require('assert') | ||
/* global suite test */ | ||
suite('kexec') | ||
test('+ kexec() - kexec echovp - two arguments, empty list', function(done) { | ||
var echoFile = path.join(__dirname, './files/echovp-empty.sh'); | ||
test('+ kexec() - kexec echovp - two arguments, empty list', function (done) { | ||
var echoFile = path.join(__dirname, './files/echovp-empty.sh') | ||
exec(echoFile, function(error, stdout, stderr) { | ||
assert(stdout.trim() === ''); | ||
assert(stderr.trim() === ''); | ||
assert( error === null ); | ||
done(); | ||
}); | ||
exec(echoFile, function (error, stdout, stderr) { | ||
assert(stdout.trim() === '') | ||
assert(stderr.trim() === '') | ||
assert(error === null) | ||
done() | ||
}) | ||
}) | ||
var exec = require('child_process').exec | ||
, path = require('path') | ||
, assert = require('assert'); | ||
var path = require('path') | ||
var assert = require('assert') | ||
/* global suite test */ | ||
suite('kexec') | ||
test('+ kexec() - kexec echovp - two arguments', function(done) { | ||
var echoFile = path.join(__dirname, './files/echovp.sh'); | ||
test('+ kexec() - kexec echovp - two arguments', function (done) { | ||
var echoFile = path.join(__dirname, './files/echovp.sh') | ||
exec(echoFile, function(error, stdout, stderr) { | ||
assert(stdout.trim() === 'hello world'); | ||
assert(stderr.trim() === ''); | ||
assert( error === null ); | ||
done(); | ||
}); | ||
exec(echoFile, function (error, stdout, stderr) { | ||
assert(stdout.trim() === 'hello world') | ||
assert(stderr.trim() === '') | ||
assert(error === null) | ||
done() | ||
}) | ||
}) | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55
11862
1
2
50
+ Addednan@^2.4.0
+ Addednan@2.22.0(transitive)