line-observable-rxjs
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Line Observable RxJs

Convert an input stream to observable of lines

Usage Example

We have the following script:

// script.js
const { getLinesFromStream } = require('line-observable-rxjs')
getLinesFromStream(process.stdin).subscribe({
  next: line => console.log('line>', line.trim()),
  complete: () => console.log('done.')
})

Run the script:

printf 'abc\ndef\nghi' | node script.js

Expected Output:

line> abc
line> def
line> ghi
done.

License

MIT © Hoàng Văn Khải

Package Sidebar

Install

npm i line-observable-rxjs

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

5.45 kB

Total Files

11

Last publish

Collaborators

  • khai96_