node-pty

Native forkpty bindings that give Node.js real pseudoterminal processes

Library
npm
v1.1.0
2,053 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
89 /100 Excellent
Development Activity 96
Maintenance 84
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 80
Code Quality 78
Innovation 74
Learning Curve 70

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 17 apps in this directory

TypeScript
95%
MIT

melty

AI Code Assistants · Code Editors · Developer Tools

5,462

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
67
Dependency
Built with
TypeScript 95%
Updated 1 years ago
TypeScript
72%
Apache 2.0

open-design

Design Tools

103,625

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
85
Repo Health
86
Technical
72
Dependency
Built with
TypeScript 72%
HTML 21%
Updated 5 days ago
TypeScript
96%
MIT

Orca

AI Agents · AI Code Assistants

104,104

An open-source Agent Development Environment that orchestrates fleets of parallel AI coding agents — Claude Code, Codex, Gemini and more — each running in its own isolated git worktree.

View details
84
Repo Health
85
Technical
74
Dependency
Built with
TypeScript 96%
Updated 5 days ago
TypeScript
98%
AGPL 3.0

paseo

AI Agents · AI Code Assistants

21,830

One unified interface to orchestrate Claude Code, Codex, Copilot, OpenCode, and Pi agents in parallel from desktop, mobile, or the terminal.

View details
88
Repo Health
83
Technical
66
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
98%
Apache 2.0

rowboat

AI Assistants · AI Development

18,060

Build, test, and deploy multi-agent AI workflows with a visual editor, RAG data sources, MCP tool integration, and a production-ready REST API.

View details
88
Repo Health
72
Technical
65
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
85%
Apache 2.0

superset

AI Code Assistants · AI Development

15,503

Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.

View details
86
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 85%
Updated 5 days ago
Go
75%
AGPL 3.0

Teleport

Authentication · Security

21,016

Zero-trust infrastructure access platform that replaces credentials and VPNs with short-lived certificates, SSO, and identity-aware proxies for SSH, Kubernetes, databases, RDP, and AI agents.

View details
94
Repo Health
81
Technical
68
Dependency
Built with
Go 75%
TypeScript 16%
Updated 1 weeks ago
TypeScript
95%
Apache 2.0

Void

AI Code Assistants · Automation · Code Editors

28,733

Open-source AI code editor with direct LLM integration and data privacy

View details
44
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 95%
Updated 4 months ago

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