npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pty-daemon

v0.10.1

Published

PTY daemon helper for Monolex terminal functionality

Downloads

4

Readme

@monolex/pty-daemon

PTY daemon helper for Monolex terminal functionality. This package provides a standalone PTY daemon that can be used by the Monolex app to create terminal sessions even when the main app's spawn-helper has Hardened Runtime restrictions.

Installation

npm install -g @monolex/pty-daemon

What's New in v0.10.0

  • Pre-built binaries for macOS arm64 - No Python or Xcode required!
  • Automatic Hardened Runtime removal - Works in production apps
  • Faster installation - Skip compilation on supported platforms

The postinstall script will automatically:

  1. Use pre-built binaries if available (macOS arm64)
  2. Otherwise compile node-pty for your system
  3. Fix spawn-helper permissions and signature
  4. Find and save Electron path for daemon usage
  5. Test the spawn-helper functionality

How It Works

This daemon runs as a separate process using Electron's Node.js runtime (ELECTRON_RUN_AS_NODE=1) and provides PTY functionality through Unix domain sockets.

Architecture

Monolex App (Production)
    ↓
  IPC Handler
    ↓
  Daemon Process (this package)
    ├─ node-pty (without Hardened Runtime)
    ├─ Unix domain sockets
    └─ PTY sessions

Usage

Automatic (via Monolex app)

The Monolex app will automatically detect and use this daemon when installed globally.

Manual Start

# With Electron (recommended)
ELECTRON_RUN_AS_NODE=1 /path/to/electron monolex-pty-daemon

# With system Node.js (if ABI compatible)
monolex-pty-daemon

Control Commands

The daemon exposes a control socket at ~/.monolex/sockets/daemon-control.sock for management:

  • create-session - Create a new PTY session
  • remove-session - Remove a PTY session
  • list-sessions - List all active sessions
  • resize-session - Resize terminal dimensions
  • status - Get daemon status
  • shutdown - Gracefully shut down daemon

Configuration

Create a config file and pass it to the daemon:

{
  "sessionPrefix": "daemon",
  "maxSessions": 10,
  "defaultShell": "bash",
  "defaultCols": 120,
  "defaultRows": 40,
  "socketDir": "~/.monolex/sockets",
  "logFile": "/tmp/monolex-pty-daemon.log"
}
monolex-pty-daemon --config /path/to/config.json

Troubleshooting

spawn-helper Issues

If you see posix_spawnp failed errors:

  1. Check spawn-helper signature:
codesign -dvvv node_modules/node-pty/build/Release/spawn-helper
  1. If it has "Runtime Version", the postinstall script should fix it automatically.

  2. Manual fix if needed:

# Remove Hardened Runtime
codesign --remove-signature node_modules/node-pty/build/Release/spawn-helper
codesign --force --sign - node_modules/node-pty/build/Release/spawn-helper

Logs

Check daemon logs at:

  • /tmp/monolex-pty-daemon.log - Daemon runtime logs
  • /tmp/pty-daemon.log - PTY process logs

Testing

Run the test script:

npm test

This will verify that spawn-helper can create PTY processes correctly.

Requirements

  • macOS, Linux, or Windows
  • Node.js 18+ or Electron 20+
  • Build tools (only if pre-built binaries not available):
    • macOS: xcode-select --install (not needed for Apple Silicon)
    • Linux: apt-get install build-essential
    • Windows: npm install -g windows-build-tools

License

MIT

Support

Report issues at: https://github.com/monolex/pty-daemon/issues