rustybun
v0.2.0
Published
Readline Implementation in Rust for Bun.
Downloads
57
Readme
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