commandland

0.1.3 • Public • Published

commandland

I make executing commands look good.

Nah

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

Run a command

import { run } from "commandland"
let { code, out } = await run("ls", ["/"])

Execution options

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

Replay a session

import { run, replay } from "commandland"
let { session } = await run("ls", ["/"], { record: true })
await replay(session)

Readme

Keywords

Package Sidebar

Install

npm i commandland

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

8.38 kB

Total Files

6

Last publish

Collaborators

  • winton