0.39.1
deno wrapper over rust protable-pty that exposes a simple interface
Attributes
Includes Deno configuration
Repository
Current version released
7 months ago
Dependencies
Versions
- 0.39.1Latest
- 0.39.0
- 0.38.0
- 0.37.1
- 0.37.0
- 0.36.0
- 0.35.1
- 0.35.0
- 0.34.0
- 0.33.1
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.28.0
- 0.27.0
- 0.26.4
- 0.26.3
- 0.26.2
- 0.26.1
- 0.26.0
- undefined
- 0.24.0
- 0.23.0
- 0.21.0
- 0.19.6
- 0.19.5
- 0.19.3
- 0.19.2
- 0.19.1
- 0.19.0
- 0.18.0
- 0.17.1
- 0.17.0
- 0.16.0
- 0.15.2
- 0.15.1
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
Deno Pty FFI
deno wrapper over https://docs.rs/portable-pty/latest/portable_pty/ that exposes a simple interface
Usage
import { Pty } from "jsr:@sigma/pty-ffi";
const pty = new Pty("bash");
// executs ls -la repedetly and shows output
for await (const line of pty.readable) {
console.log(line);
pty.write("ls -la\n");
}You can also use noinit module, this module expects the user to initialize the library before using it. (uesful when using deno compile or when wanting to defer initialization)
import { instantiate, libName, Pty } from "jsr:@sigma/pty-ffi/noinit";
if (Deno.build.standalone) {
await instantiate(`${import.meta.dirname}/${libName()}`);
} else {
await instantiate();
}
const pty = new Pty("bash");
// executs ls -la repedetly and shows output
for await (const line of pty.readable) {
console.log(line);
pty.write("ls -la\n");
}You can compile this with
deno compile --allow-ffi --include <libPath> myscript.tsor even cross compile
deno compile --allow-ffi --include <libExePath> --target x86_64-pc-windows-msvc myscript.ts