bracket-stream

given start and end symbols, emit the text between them as a single data event.

Usage no npm install needed!

<script type="module">
  import bracketStream from 'https://cdn.skypack.dev/bracket-stream';
</script>

README

var bracket = new Bracket('<', '>')

// file.txt contents: 
// "<p> what a wonderful day to be <strong> bold </strong> </p>"

var sample = fs.createReadStream('file.txt')

sample.pipe(bracket)
  .on('data', function(data) {
    console.log(data)
  })

Results:

p
strong
/strong
/p