spawn-cmd

Wraps child_process.spawn with 'cmd /c <command>' when it's a windows machine


Keywords
windows, child_process
License
BSD-3-Clause
Install
npm install spawn-cmd@0.0.2

Documentation

spawn-cmd

Build Status

child_process.spawn ignores PATHEXT on Windows:

nodejs/node-v0.x-archive#2318

This tiny shim provides a uniform interface to spawn a process on linux and windows:

var spawn = require('spawn-cmd').spawn;

var echo = spawn('echo', ['OHRLLY']);

echo.stdout.on('data', function() { ... });

This doesn't make commands portable, because this library doesn't do any translation of unix commands to their windows equivalents. It just uses the 'comspec' environment variable on windows. You might want to look at this if you want more:

https://github.com/ForbesLindesay/win-spawn