1.1.1 • Published 9 months ago

tt-native v1.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

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

Apache 2.0

1.1.1

9 months ago

1.1.0

9 months ago

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago