on-new-line

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

MIT 2 个版本
安装
npm install on-new-line
yarn add on-new-line
pnpm add on-new-line
bun add on-new-line
README

on-new-line

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

MIT License

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.

版本列表
1.0.0 2016-04-16
0.0.1 2016-03-11