-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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. See Cross-runtime notes for the small ways Node, Bun, and Deno differ in practice.
The dollar-shell package can be used together with stream-chain
and stream-json to create efficient pipelines.
npm i --save dollar-shellimport {$, $sh} from 'dollar-shell';π Search this wiki β ranked, deep-linked search via wiki-search; install the bookmarklet to search in place. Fallback: GitHub wiki search.
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 itsstdoutas a source stream. -
$.toβ returns itsstdinas a sink stream. -
$.ioAKA$.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 itsstdoutas a source stream. -
$sh.toβ returns itsstdinas a sink stream. -
$sh.ioAKA$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. -
capture β spawns a process using a template string and collects its
stdout/stderras strings along with the exit status β the one-call scripting and testing primitive. - Various internal utilities:
- Template string helpers:
- Platform detection:
-
spawn()and shell helpers: - Shell command builders:
$ is used as the default export.
For Node streams instead of web streams, import from dollar-shell/node β the same API with Node Readable/Writable on stdin/stdout/stderr.
See Release notes for the version history.
This package includes files to help AI coding agents and LLMs find, understand, and use it:
- AGENTS.md: Project conventions, architecture, commands, and coding guidelines
- CLAUDE.md: Claude Code instructions (redirects to AGENTS.md)
- CONTRIBUTING.md: Contribution guidelines for humans and AI agents
- llms.txt: Concise overview following the llms.txt standard
- llms-full.txt: Self-contained complete API reference
llms.txt and llms-full.txt ship inside the npm package so AI tools can read them straight from node_modules. AGENTS.md and CLAUDE.md are authoring-side docs kept in the repository.