Stream, npm, cli utilities all awesome. But some tools get repeated waaayyy too much. For example, node line-by-line stream utilities are everywhere. But they can't be created equal can they? What's the criteria for this tool? In my mind, a great line by line stream tool should:
- follow the node.js stream api as closely as possible
- Use the new stream2 api if possible and remain backwards compatible
- perform well (there can be a pretty significant performance difference between different parsing methods)
- be very well documented and tested
- interface
looks like the most noteworthy difference between the interfaces of is the use of events. some of these interfaces go like this:
var line_tool = require('line tool')
fs.createReadStream('thing.txt')
.pipe(line_tool)
line_tool.on('line', function(line) {
// do stuff with line
})
- backwards compatibility
........
- performance
how do you benchmark streams?