Rush
A simple package for integrating shell scripts into deno, because sometimes you want a full programming language when working with shell scripts.
Examples
Predefined shells include: bash
, fish
, sh
, zsh
import { bash } from 'rush'
const world = 'World'
const stdout = await bash`
echo Hello ${world}
`
console.log(stdout) // Hello World
Or for custom commands
import exec from 'rush'
const stdout = await exec('nu')`
ls | sort-by size | reverse
`
import exec from 'rush'
const stdout = await exec('python3.11')`
print("Hello ${world}")
`
console.log(stdout) // Hello World
Basically the template string gets piped into whatever command is specified in the exec
function. If you can pipe code into it, you can run it with rush.
echo 'print("Hello World")' | python3.11