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

cross-spawn

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-spawn - npm Package Compare versions

Comparing version 0.2.9 to 0.3.0

15

index.js

@@ -78,3 +78,3 @@ var fs = require('fs');

function spawn(command, args, options) {
function spawnInternal(method, command, args, options) {
var applyQuotes;

@@ -88,3 +88,3 @@ var shebang;

if (!isWin) {
return cp.spawn(command, args, options);
return cp[method](command, args, options);
}

@@ -113,6 +113,15 @@

return cp.spawn(command, args, options);
return cp[method](command, args, options);
}
function spawn(command, args, options) {
return spawnInternal('spawn', command, args, options);
}
function spawnSync(command, args, options) {
return spawnInternal('spawnSync', command, args, options);
}
module.exports = spawn;
module.exports.spawn = spawn;
module.exports.sync = spawnSync;

2

package.json
{
"name": "cross-spawn",
"version": "0.2.9",
"version": "0.3.0",
"description": "Cross platform child_process#spawn",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,2 +18,3 @@ # cross-spawn [![Build Status](https://travis-ci.org/IndigoUnited/node-cross-spawn.svg?branch=master)](https://travis-ci.org/IndigoUnited/node-cross-spawn)

- It does not allow you to run `del` or `dir`
- It does not properly escape arguments with spaces or special characters

@@ -26,5 +27,15 @@ All these issues are handled correctly by `cross-spawn`.

Exactly the same way as node's spawn, so it's a drop in replacement.
Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) or [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options), so it's a drop in replacement. Note that the sync version is only available in `node >= 0.12`.
```javascript
var spawn = require('cross-spawn');
// Spawn NPM asynchronously
var process = spawn('npm', ['list', '-g', '-depth' '0'], { stdio: 'inherit' });
// Spawn NPM synchronously
var results = spawn.sync('npm', ['list', '-g', '-depth' '0'], { stdio: 'inherit' });
```
## Tests

@@ -31,0 +42,0 @@

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