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

@karinjs/node-pty

v1.1.3

Published

Fork pseudoterminals in Node.JS

Downloads

241

Readme

@karinjs/node-pty

一个轻量级的 node-pty 预编译包,基于 @homebridge/node-pty-prebuilt-multiarch 优化。

English | 简体中文

特点

  • 🚀 极致轻量: 移除源代码,仅保留必要的预编译二进制文件
  • 🇨🇳 国内加速: 默认使用 npmmirror.com 镜像,无需额外配置
  • 💪 多架构支持: 支持主流操作系统和 CPU 架构
  • 🔧 开箱即用: 无需编译,支持多种包管理器

[!WARNING] 目前仅在 Windows Node.js 环境下完成测试。其他环境(Linux、macOS 等)的兼容性需要用户自行验证。如遇到问题,欢迎反馈。

安装

使用 npm:

npm install @karinjs/node-pty

使用 yarn:

yarn add @karinjs/node-pty

使用 pnpm:

pnpm add @karinjs/node-pty

使用别名安装:

npm install node-pty:@karinjs/node-pty
# or
npm install @homebridge/node-pty-prebuilt-multiarch:@karinjs/node-pty

支持的环境

| 操作系统 | 架构 | | ------------- | ------------------------- | | macOS | x64, arm64 | | Linux (glibc) | ia32, x64, armv6, aarch64 | | Linux (musl) | x64, armv6, aarch64 | | Windows | ia32, x64 |

注意: 仅支持 Node.js 16+ 和 Electron 16.0.0+ 版本(不含 Electron 28)

注意事项

由于采用预编译的方式分发,包的安装依赖于网络环境的稳定性。如果遇到下载问题,可以:

  1. 使用代理
  2. 切换到其他包管理器
  3. 多次重试安装

版本对照

| @karinjs/node-pty | @homebridge/node-pty-prebuilt-multiarch | | ----------------- | --------------------------------------- | | 1.0.2 | 0.11.14 |

上游项目

本项目基于以下优秀的开源项目:

开源许可

本项目基于 MIT 协议开源。感谢以下项目的贡献:

  • Copyright (c) 2012-2015, Christopher Jeffrey (MIT License)
  • Copyright (c) 2016, Daniel Imms (MIT License)
  • Copyright (c) 2018, Microsoft Corporation (MIT License)
  • Copyright (c) 2018, David Wilson (MIT License)
  • Copyright (c) 2018, oznu (MIT License)
  • Copyright (c) 2023, Homebridge (MIT License)

使用示例

import * as os from "node:os";
import * as pty from "@karinjs/node-pty";

async function run() {
  const shell = os.platform() === "win32" ? "powershell.exe" : "bash";
  const ptyProcess = pty.spawn(shell, [], {
    name: "xterm-color",
    cols: 80,
    rows: 30,
    cwd: process.env.HOME,
    env: process.env,
  });

  ptyProcess.onData((data) => {
    process.stdout.write(data);
  });

  ptyProcess.write("ls\r");
  ptyProcess.resize(100, 40);
  ptyProcess.write("ls\r");
}

run();