Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spawn-command

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spawn-command - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2-1

5

examples/simple.js

@@ -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) {

3

lib/spawn-command.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc