char-split
splits an stream on a character (e.g. \n) and emits the strings in between
Last updated 13 years ago by marcello .
zlib · Repository · Original npm · Tarball · package.json
$ cnpm install char-split 
SYNC missed versions from official npm registry.

char-split

Splits an stream on a character (e.g. \n) and emits the strings in between

Install

npm install char-split

Usage / Examples

var split = require('char-split')

stream.pipe(
    split()
        .on('data', function(data) {
            // line of text
        })
        .on('end', function(data) {
            // end of stream
        })
        .on('error', function(error) {
            // error in stream
        })
)

Optional arguments:

split(character = '\n', encoding = 'utf8')

Notes

For simplicity, char-split doesn't support multi-character split strings. This means splitting on \r\n won't work.

License

Open source software under the zlib license.

Current Tags

  • 0.2.0                                ...           latest (13 years ago)

2 Versions

  • 0.2.0                                ...           13 years ago
  • 0.1.0                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |