Numerous Packages Multiply

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

    0.1.2 • 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

    Keywords

    Install

    npm i rustybun

    DownloadsWeekly Downloads

    26

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    9.98 MB

    Total Files

    9

    Last publish

    Collaborators

    • wobsoriano