0.0.3 • Published 8 years ago

regexp-stream v0.0.3

Weekly downloads
7
License
CC0-1.0
Repository
github
Last release
8 years ago

regexp-stream

Install

npm i regexp-stream

Usage

const split = require('split');

// Outputs all lines starting with a word
const pattern = '^(\\w+)';
const flags = '';
const regex = new RegexpStream(pattern, flags);
process.stdin
  .pipe(split()) // split on newlines
  .pipe(regex)
  .pipe(process.stdout);

Constructor params are passed directly to new RegExp(pattern[, flags]).

See more examples in ./examples.

Contribute

Please do! If you have an idea, please post an issue. If you did something with your idea, please post a PR.

Todo

  • Accept regex type param

License

CC0-1.0