/ink-browser

Proof of Concept for npm:ink in the Browser

Primary LanguageTypeScript

ink in Browser

Proof of Concept for npm:ink in the Browser

Try it out

bun i
bun dev

Implementation Details

  • We use xterm.js to provide a full terminal emulator in the browser.
  • We implement the subset of the process.stdin and process.stdout APIs required by ink by redirecting them to xterm.js (see src/compat/polyfills.ts).
  • We use rsbuild to apply the polyfills and replace the implementation of problematic Node.js packages (see rsbuild.config.ts).

Credits