Skip to content
Eugene Lazutkin edited this page Sep 30, 2024 · 5 revisions

Dashboard

Node.js CI NPM version

About

The dollar-shell is a micro-library for running shell commands and using them in streams with ease in Node, Deno, Bun. It is a tiny, simple, no dependency package with TypeScript typings.

All streams are created using web streams.

The dollar-shell package can be used together with stream-chain and stream-json to create efficient pipelines.

Installation

npm i --save dollar-shell

Usage

import $, {$sh} from 'dollar-shell';

Docs

The package exports the following names:

  • $ — spawns a process using a template string. It includes the following helpers, which all spawn a process using a template string:
    • $.from — returns its stdout as a source stream.
    • $.to — returns its stdin as a sink stream.
    • $.io AKA $.through — returns a readable/writeable pair, which can be used as a transformation step in a pipeline.
  • $sh — spawns a shell process using a template string. It includes the following helpers, which all spawn a shell process using a template string:
    • $sh.from — returns its stdout as a source stream.
    • $sh.to — returns its stdin as a sink stream.
    • $sh.io AKA $sh.through — returns a readable/writeable pair, which can be used as a transformation step in a pipeline.
  • spawn() — spawns a process with advanced ways to configure and control it.
  • $$ — spawns a process using a template string based on spawn().
  • shell AKA sh — a helper to spawn a shell command using a template string.
  • Various internal utilities:

$ is used as the default export.

Clone this wiki locally