Skip to content

Risto-Stevcev/callbag-from-readline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

callbag-from-readline

Create a callbag from a readline interface

Install

yarn install callbag-from-readline

Usage

const { createInterface } = require('readline')
const { PassThrough } = require('stream')
const { pipe, forEach } = require('callbag-basics')
const fromReadline = require('callbag-from-readline')

const input = new PassThrough()
input.write('foo\nbar')
input.write('norf\nbaz\n')
input.write('worble\n')
input.end()

pipe(
  createInterface({ input }),
  fromReadline,
  forEach(console.log)
)
/*
foo
barnorf
baz
worble
*/

License

See LICENSE

About

Create a listenable callbag source from a readline interface

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published