5 ms·
I'm coding a fairly large application in Node and have never heard of EventEmitter or Streams. Does that mean I'm doing something wrong? The impression I get fr
by Kiro 12y ago
I'm coding a fairly large application in Node and have never heard of EventEmitter or Streams. Does that mean I'm doing something wrong? The impression I get from the article is that it's such a fundamental patterns that every serious application should use it.
- yazaddaruvala 12y agoWhen you say "fairly large" do you mean "a large web app" on top of Express? If so don't worry about it. If you are doing something less "frameworked". Something like custom (text/audio/video) (processing/compression/analysis). You would probably be reinventing Streams if you're not explicitly using them. Meanwhile, apart from implementing Streams, I can't think of a good usecase for EventEmmiter that isn't already in a framework like Express or Socket.io (Someone please enlighten me).
- jb55 12y agoThey are the two most common node abstractions. You can get by without them but it's pretty important to know about them. Streams are the more important one. Once you embrace streams in your applications a lot of things become easier. For example here's a small script I wrote at work to process some csvs and do stuff with them https://gist.github.com/jb55/0ea6aba86e269f1e526b https://gist.github.com/jb55/0ea6aba86e269f1e526b Needless to say before I knew about streams that program was twice as large and twice as buggy. Also check out substack's stream handbook to learn more, they are really handy.
- vkjv 12y agoYes. If you have never heard of either of these I would question whether you are sure you are even writing an application in node.