I’ve found that I like it and hate it all at the same time. Let me ramble on about my experiences with Node so far.
First, I need to say that Node.js has an awesome community. From what I can tell the community is pretty active and responsive. I haven’t seen a public smug comment referring to my ignorance of the language and it’s eco-system yet 🙂 There is also an abundance of material out there that gets you going with Node. These beginner resources out there are invaluable and a lot of people have done a really great job of piecing together what’s necessary to start a project using Node modules.
As I’ve mentioned, the eco-system is pretty vibrant. There are literally thousands of modules out there that cater to general and specific needs. Node’s package manager makes it easy to get the modules situated into your project. Dependency management is a breeze.
I have yet to see a comprehensive example of the MEAN stack that incorporates testing beyond simple integration tests. I really do want mocks. Depending on how you deal with callbacks, mocking may be hard to do. I want to be able to verify my code without hooking up live express.js calls that affect the data tier. I want to verify how my models work together without having a live connection to MongoDB. I also want a decent way to escape callback hell.
That said, there are some patterns that I’m seeing in terms of components used to construct Web apps and service APIs:
- express – MVC, API framework
- mongoose – MongoDB ODM
- underscore – collection handling, functional stuff
- sinon.js – mocking, stubbing, etc..
- mocha.js – test runner, framework
- chai.js – assertions
- should.js – assertions +
Those are the modules that you can easily use to get up and running using one of the various samples out there. When I get more comfortable with the ins and outs of the stack, I’ll post something that captures how these pieces work together. But for now, I’m still exploring.
This brings me to my other concern. I don’t see established patterns or archetypes defined for Node.js development work and project structures. Express doesn’t mandate a project structure, but it offers one up. I’ve found that I need to tweak it to fit my needs. I imagine this is pretty common. This is a little uncomfortable to me since I’m pretty much looking for standard ways to do things. There are a few recommendations out there as to how to organize project structures, but it’s still opened. This does make it tough to orient yourself when you’re browsing other projects to see what’s going on.
All in all, I like where Node.js is going. The momentum is there, the promise is there, but the standards are not. If it is, then I do not see it and need to be pointed to any resource that can help 🙂
Anyway… More to come. I’ll probably start pushing up my stuff up to Github so that I can share code and have something concrete to talk about rather than rants about a language that I know little about.