regexp-stream

0.0.3 • Public • Published

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

Package Sidebar

Install

npm i regexp-stream

Weekly Downloads

3

Version

0.0.3

License

CC0-1.0

Last publish

Collaborators

  • stigok