@replit/ruspty
TypeScript icon, indicating that this package has built-in type declarations

3.4.15 • Public • Published

@replit/ruspty - PTY for JavaScript through Rust FFI

A very thin wrapper around PTYs and processes.

const { Pty } = require('@replit/ruspty');

const pty = new Pty({
  command: '/bin/sh',
  args: [],
  envs: {},
  size: { rows: 24, cols: 80 },
  onExit: (...result) => {
    // TODO: Handle process exit.
  },
});

const read = pty.read;
const write = pty.write;

read.on('data', (chunk) => {
  // TODO: Handle data.
});
write.write('echo hello\n');

Local Development

  • npm install
  • npm run build
  • npm run test

Publishing

Following "Publish It" section from napi-rs docs:

  1. git clean -f && npm install && npm run build
  2. npm version [major|minor|patch]
  3. Send that as a Pull Request to GitHub. Ensure that the commit message consisting only of x.y.z - this is how the CI decides to publish to npm!

NPM_TOKEN is part of the repo secrets, generated like this.

Readme

Keywords

none

Package Sidebar

Install

npm i @replit/ruspty

Weekly Downloads

710

Version

3.4.15

License

MIT

Unpacked Size

135 kB

Total Files

21

Last publish

Collaborators

  • jonesit-replit
  • ltazmin_replit
  • stkenned
  • moudy
  • lhchavez
  • masad-frost
  • ryantm
  • tobyho
  • cbrewster
  • theflowingsky
  • brianpool
  • brenoafb
  • ink404
  • alexisreplit
  • replitdstewart
  • ryanweingast
  • jackyzha0
  • szymon_k
  • lopezhoracio
  • jamesaustinreplit
  • talorreplit
  • eng-service
  • daweifeng-replit