I am experimenting with Meteor, and fall in love with it. My question is:
Can I install any nodeJS package, such as NodeMailer, on my Meteor and get it work out of the box? If not, what are usual steps to get it running?
The short answer is no, Meteor has a dependency on Fibers which breaks native compatibility with many pacakges. Currently, getting a package that doesn't use Fibers to work within Meteor is done case-by-case. Here is a recent example
You can follow these instructions to ensure your packages get deployed with your meteor app.
Here is rationale for why Meteor is built with Fibers by David Greenspan, one of Meteor's core devs, emphasis mine:
There's actually no inherent or obvious performance trade-off [between using Fibers or not], so we chose to expose the simpler API (or both).
The Node model is basically your app gets one thread, the event loop. If you want your app to be fast, the request handler had better get off the thread fast! The way it does this in vanilla Node is by finishing and returning, after passing a callback somewhere if there is more work to be done. With fibers, the request handler can instead "yield" when it's doing I/O, so it gets off the thread, but invisibly to the programmer. It's as if there are callbacks happening inside the synchronous calls, but the callback is just the continuation of the program. This is what streamline is trying to simulate, but it happens at the V8 level.
The important point is that Meteor's "synchronous" calls don't block, they yield to the event loop. Whereas normally the event loop would bounce around between whatever callbacks need calling, it instead bounces between whatever functions need further execution.