execpe
v4.0.2
Published
Replace your Node.js process with another process. Like Ruby exec.
Downloads
31
Maintainers
Readme
Node.js - execpe
This module causes your current Node.js process to be replaced by the process invoked by the parameter of this function. It's like the Ruby exec function. It currently does not work on Windows. It is a fork of JP Richardson's execpe with ability to override environment.
Usage
var execpe = require('execpe')
execpe('top') // your process now becomes top. equivalent of execpe('top', [], process.env);
var execpe = require('execpe')
execpe('du', [ '-sh', '/etc/fstab' ]) // your process now becomes du, with the arguments indicated
var execpe = require('execpe')
// your process now becomes du, with the arguments and environment as indicated
execpe('du', [ '-sh', '/etc/fstab' ], Object.assign({}, process.env, { TERM: 'bare' }))
Details
execpe
can be called with one argument, where the first is the name of the executable,
second is a list of params and third is a map of environment variables. Map of variables
defaults to process.env.
License
(The MIT License)
Copyright (c) 2011-2017 JP Richardson & Jakub Skopal