rustybun
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

RustyBun

Readline implementation in Rust for Bun. RustyLine Bun ffi wrapper.

Install

bun add rustybun

Usage

import RustyBun from 'rustybun'

const rb = new RustyBun()

const { success } = rb.loadHistory('history.txt')
if (!success) {
  console.log('No previous history.')
}

while (true) {
  const line = rb.readline();
  if (line.signal === 'CtrlC') {
    console.log('CtrlC')
    break
  }
  if (line.signal === 'CtrlD') {
    console.log('CtrlD')
    break
  }
  console.log(line.value)
}

rb.saveHistory('history.txt')

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    1
  • 0.1.2
    0
  • 0.1.1
    1
  • 0.1.0
    0

Package Sidebar

Install

npm i rustybun

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

14.6 MB

Total Files

10

Last publish

Collaborators

  • wobsoriano