Skip to content

Get the command to spawn according to the current platform

License

Notifications You must be signed in to change notification settings

soyuka/platform-shell-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Platform Shell Command

Tired of having to check the platform before you can launch the correct spawn command? This module gives you the correct command and arguments according to your platform.

Installation

npm install platform-shell-command --save

Usage

const spawn = require('child-process').spawn
const platformShellCommand = require('platform-shell-command')
const {command, args} = platformShellCommand('node foobar.js')

spawn(command, args)

Command and arguments will end up spawning:

  • /bin/sh -c node foobar.js on linux
  • cmd.exe /d /s /c "node foobar.js" on windows

License

MIT

About

Get the command to spawn according to the current platform

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published