I make executing commands look good.
Feature |
---|
Live stdout with ASCII colors |
Live stdin |
(Or keep live stdout/stdin silent) |
Capture output as string |
Exit code and signal capture |
Session record & playback |
import { run } from "commandland"
let { code, out } = await run("ls", ["/"])
Option | Example | Purpose |
---|---|---|
args | ["/"] |
Command arguments |
command | "ls" |
Command to execute |
cols, rows | 100 , 100 |
Column and rows for pty |
cwd | process.env.HOME |
Working directory for pty |
env | process.env |
Environment for pty |
onData | ()=>{} |
Pty data callback |
record | false |
Record the session |
silent | false |
Execute without stdout |
stdin | false |
Allow stdin input |
import { run, replay } from "commandland"
let { session } = await run("ls", ["/"], { record: true })
await replay(session)