Skip to main content
Bun Shell is a cross-platform bash-like shell built into Bun. It runs shell commands from JavaScript and TypeScript. To get started, import the $ function from the bun package.
foo.ts

The $ function is a tagged template literal that runs the command and returns a promise that resolves with the command’s output.
foo.ts

To iterate over each line of the output, use the lines method.
foo.ts

See Bun Shell.