New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@triggi/native-exec

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@triggi/native-exec

Module that provides access to POSIX exec* functions

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

@triggi/native-exec

Build Status

Module that provides access to POSIX exec* functions.

This is a fork of https://github.com/OrKoN/native-exec Inspired by: https://github.com/jprichardson/node-kexec

Installation

requires a C++ compiler installed, most probably.

npm i @triggi/native-exec

Usage

Replace the current process with another one:

var exec = require('@triggi/native-exec');

exec('ls'); // => the process is replaced with ls, which runs and exits

Replace the current process with another one and replace process' env:

var exec = require('@triggi/native-exec');

exec('ls', {
  newEnvKey: newEnvValue,
}); // => the process is replaced with ls -lsa, which runs and exits

Replace the current process with another one, replace process' env and provide arguments:

var exec = require('@triggi/native-exec');

exec('ls', {
  newEnvKey: newEnvValue,
}, '-lsa'); // => the process is replaced with ls, which runs and exits

Use case

If you want to have a bootstrap script written in NodeJS you can use this module to replace the bootstrap process with the process that you actually intend to run specifying env and arguments.

LICENSE

MIT

Keywords

exec

FAQs

Package last updated on 05 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts