This year has been all about node for me. I mentioned at the start of the year that I’d like to learn it, and it looks like my wish came true.
We quickly became aware that we should put together a starter kit with the tools and libraries we were using on a regular basis, and we came up with BESK, short for back end starter kit. This includes common libraries such as express, handlebars, lodash, moment, mongoose and q by default. It also has a lot of boiler plate, such as our clever solution to routing, so starting a new project is as simple as cloning the repo and writing some code.
Working with node required an adjustment to how I thought about building apps, but once I understood the core concepts it wasn’t too hard to get started. In fact, I quite enjoyed knowing I wouldn’t have to worry about obscure browser bugs – if the app works, it works.
A few tips I’d give to someone new to node are:
- Use nodemon when developing locally, that way you won’t have to restart your app every time you add a new module
- Abstract as much of your code into reusable modules as possible
- Use mongoose if you’re interacting with MongoDB
- Use forever-monitor to keep your app running in production
If you enjoyed the read, drop us a comment below or share the article, follow us on Twitter or subscribe to our #MetaBeers newsletter. Before you go, grab a PDF of the article, and let us know if it’s time we worked together.