Skip to content

zhouzhongyuan/npm-spawn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm-spawn

In Cli

  npm install

In npm-spawn

var npmCmd = require('npm-spawn');
npmCmd(['install'], options)

Examples

npm install => npmCmd(['install'])
npm run build => npmCmd(['run','build])

args

npm install ['install']
npm run build ['run', 'build']

Options

More Options

format like below:

var options = {cwd:'src'};
  • command The command to run
  • args List of string arguments
  • options
  • cwd Current working directory of the child process
  • env Environment key-value pairs
  • stdio | Child's stdio configuration. (See options.stdio)
  • detached Prepare child to run independently of its parent process. Specific behavior depends on the platform, see options.detached)
  • uid Sets the user identity of the process. (See setuid(2).)
  • gid Sets the group identity of the process. (See setgid(2).)
  • shell | If true, runs command inside of a shell. Uses '/bin/sh' on UNIX, and 'cmd.exe' on Windows. A different shell can be specified as a string. The shell should understand the -c switch on UNIX, or /s /c on Windows. Defaults to false (no shell).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published