# tt-native

> libtt JavaScript bindings for Node.js

Latest version **1.3.0** (published 2026-10-23) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install tt-native
pnpm add tt-native
yarn add tt-native
bun add tt-native
```

## Health

**Score 60/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2026-10-23 |
| First published | 2022-11-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5 |
| Author | Holepunch |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/tt-native
- Repository: https://github.com/holepunchto/tt-native
- Homepage: https://github.com/holepunchto/tt-native#readme
- Issues: https://github.com/holepunchto/tt-native/issues
- npm.io page: https://npm.io/package/tt-native

## Dependencies (2)

- [streamx](https://npm.io/package/streamx.md) ^2.12.5
- [require-addon](https://npm.io/package/require-addon.md) ^1.0.2

## Recent versions

- 1.3.0 (latest) — 2026-10-23
- 1.2.0 — 2026-10-21
- 1.1.1 — 2024-09-13
- 1.1.0 — 2024-09-12
- 1.0.4 — 2023-01-05
- 1.0.3 — 2022-11-21
- 1.0.2 — 2022-11-08
- 1.0.1 — 2022-11-08
- 1.0.0 — 2022-11-07

## README

# tt-native

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

```sh
npm install tt-native
```

## Usage

```js
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](https://github.com/streamxorg/streamx#duplex-stream).

Options include:

```js
{
  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

---
_Source: https://npm.io/package/tt-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
