Read and write ndjson messages over a duplex stream
npm install it-ndjson-stream

> Read and write ndjson messages over a duplex stream
This module makes it easy to send and receive ndjson messages over streams.
``typescript
import { ndjsonStream } from 'it-ndjson-stream'
const stream = ndjsonStream(duplex)
// read the next message
const obj = await stream.read()
// write a message
await stream.write({ hello: 'world' })
// write several messages
await stream.writeV([
{ hello: 'world' },
{ how: 'are you' }
])
`
`console`
$ npm i it-ndjson-stream
-
Licensed under either of
- Apache 2.0, (LICENSE-APACHE /
- MIT (LICENSE-MIT /
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.