JSPM

on-new-line

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 338
  • Score
    100M100P100Q88335F
  • License MIT

Hijacks NodeJS Stream and emits events when newline(s) written to the output.

Package Exports

  • on-new-line

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (on-new-line) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

on-new-line

Hijacks NodeJS Stream and emits events when newline(s) written to the output.

MIT License npm:

Install

$ npm install on-new-line --save

Usage

require('on-new-line')(stream); // Any type of NodeJS stream, such as: filestream, process.stdout etc.

// emitted on every newline detected
stream.on('newline', function() {

});

// emitted before data written to the output. 
stream.on('before:newlines', function(lineCount) {

});

// emitted after data written to the output. 
stream.on('after:newlines', function(lineCount) {

});

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.