node-pty

Native forkpty bindings that give Node.js real pseudoterminal processes

Library
npm
v1.1.0
2,005stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
80/100Excellent
Development Activity76
Maintenance68
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture80
Code Quality78
Innovation74
Learning Curve70

node-pty is Microsoft’s native addon that exposes forkpty(3)-style pseudoterminal bindings to Node.js, letting an application spawn a shell or any other process behind a real PTY instead of a plain pipe. Because the child believes it is talking to an actual terminal, programs that emit control sequences, resize themselves, or need line-discipline behavior work exactly as they would in a native terminal.

It powers the integrated terminal in Visual Studio Code as well as terminal emulators like Hyper, Theia, and Extraterm, and it bridges the platform gap by using conpty on modern Windows and native forkpty on Linux/macOS behind one consistent API.

What You Get

  • A pty.spawn() API that forks any executable behind a pseudoterminal and returns a terminal object with onData, write, resize, and kill
  • Cross-platform parity via native forkpty on Linux/macOS and the Windows ConPTY API on Windows 10 1809+
  • TypeScript type declarations for the full public API (typings/node-pty.d.ts)
  • Automatic flow control support (XON/XOFF or custom pause/resume sequences) to avoid overwhelming child processes
  • Prebuilt native binaries fetched at install time, falling back to node-gyp rebuild from source

Common Use Cases

  • Building a terminal emulator UI in a desktop or web app (e.g. paired with xterm.js)
  • Embedding an interactive shell inside an Electron or VS Code-style IDE
  • Driving CLI tools that require an attached TTY to behave correctly (interactive prompts, progress bars, color output)
  • Building browser-based terminal-over-HTTP tools like web SSH clients

Under The Hood

Architecture - node-pty splits into a thin TypeScript dispatch layer (src/index.ts) that picks UnixTerminal or WindowsTerminal at require-time based on process.platform, and a native binding compiled per-platform (C++ under src/unix/src/win) that actually calls forkpty(3) or the Windows ConPTY API; a worker subdirectory offloads the Windows console-list agent to a child process so the main thread stays responsive. Tech Stack - TypeScript for the public API and tests (mocha), C++ for the native addon built via node-gyp/binding.gyp and node-addon-api, with prebuilt binaries fetched by scripts/prebuild.js at install time and a node-gyp rebuild fallback. Code Quality - the repo carries real unit tests (terminal.test.ts, unixTerminal.test.ts, windowsTerminal.test.ts, eventEmitter2.test.ts) run via mocha plus ESLint enforced as a post-test step, and TypeScript typings are hand-maintained in typings/node-pty.d.ts as the API contract; native/platform code is comparatively harder to cover with automated tests and relies more on manual/CI verification across OSes. API Design - the public surface is deliberately small (spawn, deprecated fork/createTerminal aliases, and a returned terminal object exposing onData, write, resize, kill), which keeps the learning curve low, though Windows-vs-Unix option differences (e.g. IWindowsPtyForkOptions) leak into the typings and require platform awareness from consumers.

Used by 16 apps in this directory

TypeScript
99%
MIT

Cate

AI Code Assistants

2,087

A desktop IDE built on an infinite canvas — spread code editors, terminals, browsers, docs, and AI agents across freeform space instead of stacking windows and tabs, with layouts restored automatically.

View details
79
Repo Health
71
Technical
72
Dependency
Built with
TypeScript99%
Updated yesterday
PHP
79%
Apache 2.0

Coolify

Devops · Hosting Control Panel

60,738

Open-source self-hosted PaaS — deploy apps, databases and 280+ services on your own servers with no vendor lock-in

View details
92
Repo Health
86
Technical
72
Dependency
Built with
PHP79%
Blade18%
Updated 2 days ago
TypeScript
97%
MIT

DenchClaw

CRM · AI Agents

1,643

An AI-native CRM you self-host on your own machine, built on the OpenClaw agent framework, with a DuckDB backend and pre-built agent skills for managing contacts, deals, reports, and 500+ outreach integrations from natural-language chat.

View details
69
Repo Health
73
Technical
71
Dependency
Built with
TypeScript97%
Updated 2 months ago
TypeScript
99%
Other

Dokploy

Devops · Hosting Control Panel · Security

36,702

Self-hosted PaaS that deploys apps and databases on your own VPS using Docker, Traefik, and multi-build-system orchestration

View details
89
Repo Health
76
Technical
65
Dependency
Built with
TypeScript99%
Updated 2 days ago
TypeScript
96%
Other

Dyad

AI Development · Productivity · AI Code Assistants

21,279

Build AI-powered apps locally with your own keys, your own models, and zero cloud lock-in.

View details
88
Repo Health
83
Technical
70
Dependency
Built with
TypeScript96%
Updated yesterday
TypeScript
98%
MIT

Kimi Code CLI

AI Code Assistants · AI Agents · Developer Tools

6,908

A single-binary, terminal-native coding agent that reads, edits, and runs code end to end, built by Moonshot AI for Kimi models but pluggable with Anthropic, OpenAI, and Google providers too.

View details
81
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
98%
Apache 2.0

letta-code

AI Code Assistants · AI Assistants

3,050

A memory-first coding agent harness that learns from experience, maintains identity across models, and works across Claude, GPT, Gemini, and dozens more LLMs.

View details
84
Repo Health
84
Technical
78
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
95%
MIT

melty

Developer Tools · AI Code Assistants · Code Editors

5,449

The AI code editor where every chat message is a git commit you can revert, branch, or squash

View details
35
Repo Health
75
Technical
68
Dependency
Built with
TypeScript95%
Updated 1 years ago
TypeScript
72%
Apache 2.0

open-design

Design Tools

89,112

Local-first, open-source Claude Design alternative that turns your existing coding agent CLI into a full agentic design studio — with 259+ skills, 142+ design systems, and sandboxed artifact delivery across web, desktop, and mobile surfaces.

View details
84
Repo Health
86
Technical
73
Dependency
Built with
TypeScript72%
HTML20%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search