-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Eugene Lazutkin edited this page Sep 30, 2024
·
5 revisions
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.
npm i --save dollar-shell
import $, {$sh} from 'dollar-shell';
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 itsstdout
as a source stream. -
$.to
— returns itsstdin
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 itsstdout
as a source stream. -
$sh.to
— returns itsstdin
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 onspawn()
. -
shell AKA
sh
— a helper to spawn a shell command using a template string. - Various internal utilities:
- Template string helpers:
-
spawn()
and shell helpers: - Shell command builders:
$
is used as the default export.