readable-error

1.0.0 • Public • Published

readable-error

A readable stream which emits an error. The error given to the constructor will be emitted after the first read attempt.

Usage

Just give the error to the constructor:

const ReadableError = require('readable-error')

const stream = new ReadableError(new Error('test'))

stream.on('error', (err) => {
  console.log(err.message)
})

stream.resume()

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    12,523
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    12,523

Package Sidebar

Install

npm i readable-error

Weekly Downloads

3,494

Version

1.0.0

License

MIT

Last publish

Collaborators

  • bergos