tt-native

1.0.4 • Public • Published

tt-native

https://github.com/holepunchto/libtt JavaScript bindings for Node.js.

npm install tt-native

Usage

const { spawn } = require('tt-native')

const pty = spawn('node', ['script.js'])

API

const pty = spawn(file[, args][, options])

Spawn a process attached to a pseudo TTY. The returned PTY is a duplex stream.

Options include:

{
  width: 80,
  height: 60,
  env: process.env,
  cwd: process.cwd()
}

pty.width

The current width of the PTY.

pty.height

The current height of the PTY.

pty.pid

The process ID of the spawned process.

pty.on('exit', code[, signal])

Emitted when the process exit.

pty.resize(width, height)

Resize the PTY.

pty.kill([signal])

Kill the process with the specified signal, which defaults to SIGINT. The following signals may be used:

  • SIGINT
  • SIGKILL
  • SIGTERM

License

ISC

Readme

Keywords

none

Package Sidebar

Install

npm i tt-native

Weekly Downloads

5

Version

1.0.4

License

ISC

Unpacked Size

326 kB

Total Files

20

Last publish

Collaborators

  • kasperisager