spawn-command
Advanced tools
Comparing version 0.0.1 to 0.0.2-1
@@ -1,3 +0,4 @@ | ||
var spawnCommand = require('../'); | ||
child = spawnCommand('echo "Hello spawn" | base64'); | ||
var spawnCommand = require('../'), | ||
command = (process.platform === 'win32') ? 'echo "Hello spawn"' : 'echo "Hello spawn" | base64', | ||
child = spawnCommand(command); | ||
@@ -4,0 +5,0 @@ child.stdout.on('data', function (data) { |
@@ -0,1 +1,2 @@ | ||
var util = require('util'); | ||
var spawn = require('child_process').spawn; | ||
@@ -8,2 +9,4 @@ | ||
args = ['/s', '/c', '"' + command + '"']; | ||
options = util._extend({}, options); | ||
options.windowsVerbatimArguments = true; | ||
} | ||
@@ -10,0 +13,0 @@ else { |
@@ -5,7 +5,15 @@ { | ||
"description": "Spawn commands like `child_process.exec` does but return a `ChildProcess`", | ||
"version": "0.0.1", | ||
"version": "0.0.2-1", | ||
"main": "./lib/spawn-command", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mmalecki/spawn-command" | ||
}, | ||
"scripts": { | ||
"test": "node test/spawn-command-test.js" | ||
} | ||
}, | ||
"devDependencies": { | ||
"assert-called": "0.1.x" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -13,3 +13,3 @@ # spawn-command [![Build Status](https://secure.travis-ci.org/mmalecki/spawn-command.png)](http://travis-ci.org/mmalecki/spawn-command) | ||
child.on('stdout', function (data) { | ||
child.stdout.on('data', function (data) { | ||
console.log('data', data); | ||
@@ -16,0 +16,0 @@ }); |
var path = require('path'), | ||
assert = require('assert'), | ||
assertCalled = require('assert-called'), | ||
spawnCommand = require('../'); | ||
var child = spawnCommand('grep commit < ' + path.join(__dirname, 'fixtures', 'commit')), | ||
var win32 = (process.platform === 'win32'), | ||
newln = win32 ? '\r\n' : '\n', | ||
grep = win32 ? 'findstr' : 'grep', | ||
child = spawnCommand(grep + ' commit < ' + path.join(__dirname, 'fixtures', 'commit')), | ||
stderr = '', | ||
@@ -18,11 +22,6 @@ stdout = '', | ||
child.on('exit', function (exitCode) { | ||
exited = true; | ||
child.on('exit', assertCalled(function (exitCode) { | ||
assert.equal(exitCode, 0); | ||
assert.equal(stdout, 'commit 26b11915b1c16440468a4b5f4b07d2409b98c68c\n'); | ||
assert.equal(stdout, 'commit 26b11915b1c16440468a4b5f4b07d2409b98c68c' + newln); | ||
assert.equal(stderr, ''); | ||
}); | ||
process.on('exit', function () { | ||
assert(exited); | ||
}); | ||
})); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
4055
47
0
0
1
2