0.0.8 • Published 3 years ago

terminal-tab v0.0.8

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

Terminal Tab

Open a terminal tab programatically.

Install

npm install terminal-tab -g

Getting started

const terminalTab = require('terminal-tab')

terminalTab.open(`echo "my command"; sleep 2 && exit`)

Options

Child process command options:

const options = {
  cwd: null,
  env: null,
  encoding: 'utf8'
}

terminalTab.open(`echo "my command"`, options)

Event callbacks

terminalTab.open(`echo "my command"`, options, {
  onStdout: (stdout) => {},
  onStderr: (stderr) => {},
  onError: (error) => {},
  onExit: (code, signal) => {
    console.log('exit:', code, signal)
    process.exit(0)
  }
})

Alternatively:

terminalTab.open(`echo "my command"`, options, (stdout) => {})

Without options:

terminalTab.open(`echo "my command"`, (stdout) => {})

CLI

terminal_tab 'echo hello'

Piping

echo 'echo hello' | terminal_tab

License

MIT

0.0.8

3 years ago

0.0.7

5 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago