https://github.com/marcello3d/node-char-split
https://github.com/marcello3d/node-char-split
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marcello3d/node-char-split
- Owner: marcello3d
- License: zlib
- Created: 2013-05-31T18:24:23.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2017-06-12T00:39:19.000Z (about 8 years ago)
- Last Synced: 2025-04-23T01:04:23.743Z (3 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
char-split
=================Splits a string stream on a character (e.g. \\n) and emits the strings in between.
Install
-------```
npm install char-split
```Usage / Examples
----------------```js
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:
```js
split(character = '\n')
```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](LICENSE).