You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@simple-libs/child-process-utils

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@simple-libs/child-process-utils

A small set of utilities for child process.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
1.5M
37.71%
Maintainers
1
Weekly downloads
 
Created
Source

@simple-libs/child-process-utils

ESM-only package NPM version Node version Dependencies status Install size Build status Coverage status

A small set of utilities for child process.

Install

# pnpm
pnpm add @simple-libs/child-process-utils
# yarn
yarn add @simple-libs/child-process-utils
# npm
npm i @simple-libs/child-process-utils

Usage

import {
  exitCode,
  catchProcessError,
  throwProcessError,
  outputStream,
  output
} from '@simple-libs/child-process-utils'

// Wait for a child process to exit and return its exit code
await exitCode(spawn())
// Returns 0 if the process exited successfully, or the exit code if it failed

// Catch error from a child process
await catchProcessError(spawn())
// Returns the error if the process failed, or null if it succeeded

// Throws an error if the child process exits with a non-zero code.
await throwProcessError(spawn())

// Yields the stdout of a child process.
// It will throw an error if the process exits with a non-zero code.
for await (chunk of outputStream(spawn())) {
  console.log(chunk.toString())
}

// Collects the stdout of a child process into a single Buffer.
// It will throw an error if the process exits with a non-zero code.
await output(spawn())
// Returns a Buffer with the stdout of the process

Keywords

child_process

FAQs

Package last updated on 01 Mar 2026

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