Git Product home page Git Product logo

node-char-split's Introduction

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

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')

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.

node-char-split's People

Contributors

defunctzombie avatar marcello3d avatar

Watchers

 avatar  avatar  avatar

Forkers

defunctzombie

node-char-split's Issues

Please use registered SPDX license id in package.json

Hi!

I would like to suggest a very minor enhancement. Consider this when you get a chance :)

I noticed that this package uses the zlib License per the README.md file. This is a fine choice. However, the package.json file does not explicitly indicate that. Ideally, the package.json file would include a license (or licenses) field using an officially registered SPDX license id (see https://spdx.org/licenses/), or the LICENSE file would start with the full name of the license, per https://spdx.org/licenses/Zlib.html#licenseText.

The reason why it is generally helpful to use an officially registered SPDX license id is that those of us who use an automated license checker (e.g., https://www.npmjs.com/package/license-checker) can automatically process this package without further whitelisting.

The other side benefit is that npm will no longer state that there is no license on this package (see https://www.npmjs.com/package/char-split)

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.