Open tvooo opened 10 years ago
That would certainly make sense. I haven't done that much work with pipes yet, so I'm not 100% certain on how to do that. Do you have an existing module that works in a similar fashion I could take a peek at?
Possible things that would have to be considered:
Ah, by "pipe" I of course mean "stream"; that's the correct Node terminology. There are modules that look for a string in a stream, for example https://github.com/mscdex/streamsearch (but you should always look at the performance as well). However, if you are using regexes, take a look at https://www.npmjs.org/package/regex-stream - I just found it, looks promising. Maybe not for direct use, as it seems to create JS objects in an opinionated way, but you can look at how it works.
Great work, Peter. Do you have any plans to make this work with pipes as well? Each colour found could be emitted through an event.