@mmmbuto/node-pty-android-arm64
v1.1.0
Published
Android/Termux-only fork of node-pty for ARM64 (bionic)
Maintainers
Readme
node-pty-android-arm64
Android/Termux-only fork of node-pty targeting ARM64 (bionic). It provides the same API as the upstream node-pty package but is focused on working reliably under Termux.
Scope
- Platform:
android - CPU:
arm64 - Intended environment: Termux on Android
If you need Linux/macOS/Windows support, use the upstream project: https://github.com/microsoft/node-pty
Install
npm install node-pty-android-arm64If you want to keep require('node-pty') in your code, you can use an npm alias:
npm install node-pty@npm:node-pty-android-arm64Build on Termux
Prerequisites:
pkg install -y nodejs python make clang pkg-config gitBuild and install:
npm install
npm run buildNotes:
- If
prebuilds/android-arm64exists, it will be used. - When building from source on Termux,
android_ndk_pathis derived fromANDROID_NDK_HOME/ANDROID_NDK_ROOTor falls back to$PREFIX.
Usage
import * as os from 'node:os';
import * as pty from 'node-pty';
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');Credits
Based on the original node-pty project by Microsoft and contributors.
