New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@jcbhmr/exec

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jcbhmr/exec

🐧 Ergonomic exec(3) for JavaScript

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

exec(3) for JavaScript

🐧 Ergonomic exec(3) for JavaScript

// Replaces the current process with a new one.
exec("node", ["--version"], {
  cwd: "/home/someone_else/projects",
  env: { HELLO: "WORLD" },
  uid: 1234,
});

🐧 Works on Linux, macOS, BSDs, and more
šŸ›‘ Does not work on Windows
šŸ‘¶ Same arguments as node:child_process spawn

Installation

npm pnpm Deno Bun

npm install @jcbhmr/exec

āš ļø This package requires a Unix-like OS (Linux, macOS, etc.). Windows is not supported. For an isomorphic cross-platform solution, consider using @jcbhmr/cross-exec.

Usage

macOS Linux Node.js Deno Bun

// Unix-like operating systems ONLY.
import exec from "@jcbhmr/exec";

exec("node", ["--version"]);

Development

macOS Linux Node.js Deno Bun

If you're on Windows you must use WSL to develop this package.

TODOs

  • Implement fd rearrangement according to the stdio options. Right now it just inherits.
  • When Deno adds process.execve() support, use that instead of FFI. https://github.com/denoland/deno/issues/29017
  • When Bun adds process.execve() support, use that instead of FFI.

Keywords

exec

FAQs

Package last updated on 29 Jan 2026

Related posts