0.2.0 • Published 1 year ago

rustybun v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

0.2.0

1 year ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago