Skip to content

deno wrapper over rust protable-pty that exposes a simple interface

License

Notifications You must be signed in to change notification settings

sigmaSd/deno-pty-ffi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deno Pty FFI

deno wrapper over https://docs.rs/portable-pty/latest/portable_pty/ that exposes a simple interface

Usage

This module requires --unstable-ffi

import * as mod from "jsr:@sigma/pty-ffi";

const pty = new Pty({
  cmd: "bash",
  args: [],
  env: [],
});

// executs ls -la repedetly and shows output
while (true) {
  await pty.write("ls -la\n");
  const { data, done } = await pty.read();
  if (done) break;
  console.log(data);
  await new Promise((r) => setTimeout(r, 100));
}

About

deno wrapper over rust protable-pty that exposes a simple interface

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published