3.4.0 • Published 9 months ago
@replit/ruspty v3.4.0
@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');
The biggest difference from existing PTY libraries is that this one works with Bun, and doesn't cross the FFI bridge for every input/output instead requiring the consumer to deal with the fd
of the PTY.
Local Development
npm install
npm run build
npm run test
Publishing
Following "Publish It" section from napi-rs
docs:
git clean -f && npm install && npm run build
npm version [major|minor|patch]
- 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 tonpm
!
NPM_TOKEN
is part of the repo secrets, generated like this.
3.4.0
9 months ago
3.2.4
9 months ago
3.2.3
9 months ago
3.2.1
10 months ago
3.1.3
12 months ago
3.0.4
1 year ago
3.1.2
1 year ago
3.0.3
1 year ago
3.2.0
11 months ago
3.1.1
1 year ago
3.0.2
1 year ago
3.1.0
1 year ago
3.0.5
1 year ago
3.0.0
1 year ago
2.2.0
1 year ago
2.1.0
1 year ago
2.0.1
1 year ago
1.1.1
1 year ago
1.0.0
1 year ago
1.0.0-alpha.1
1 year ago
1.0.0-alpha.0
1 year ago