Skip to content

jakubskopal/node-execpe

 
 

Repository files navigation

Node.js - execpe

build status JavaScript Style Guide

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

About

Node.js execpe binding

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 51.3%
  • JavaScript 28.0%
  • Makefile 11.3%
  • Python 9.4%