3 tools I love for building Node.js apps
Posted Jun 22, 2015 | 3 min. (456 words)Every developer has a set of tools that they use when building software, no matter what language or frameworks they use. Choosing tools can be tricky though, especially when you’re getting started with a new development platform. When I started writing code I went fully down the Microsoft route – Visual Studio, Windows, .NET (Well actually VB6 and ASP Classic, but we’ll gloss over that).
Then I read about Node.js and decided that I had to learn it. I spent a few hours getting setup and finding some useful tools, which quickly evolved when I got my head deep into the Node world.
Webstorm
Like most others I know, I started writing Node code in Sublime. The “lightness” of the editor after Visual Studio was refreshing and some of the smart editing helpers are kick arse. As my project grew it became harder to keep everything in my head and I was missing autocomplete.
After trying a few heavier editors, I settled on Webstorm as it’s still quick and provides decent autocomplete and a large number of sweet refactoring tools to make writing code even quicker. And coming from Resharper in Visual Studio, it was nice having similar keyboard shortcuts and tools available.
node-inspector
I initially struggled with debugging in Node. In Visual Studio you mark a breakpoint and press go. Node, being Javascript, is a little different. I started using console.log everywhere, but as you can probably guess, that became unreadable pretty quickly. And still didn’t help me pinpoint exactly where the issues were coming from.
node-inspector comes to the rescue here! Being based off the Chrome Dev tools, we already know how good the Javascript debugging tools are. Being able to step through your code and view local variables is immensely useful when figuring out why something is coming back as undefined or null. Being able to pause your code also lets you dig deeply into object trees which is far easier than dumping them out to your console and trying to scroll back through them.
Grunt
I use Grunt to run a large number of automated tasks against my code base, but one of the most useful and timesaving tasks is ‘grunt-nodemon’. Nodemon watches your code directories and restarts your Node process each time something changes, saving you having to find your terminal window, exiting Node and kicking the process off again. Whilst it may only take a few seconds, it all adds up over a day of development. And anything that saves you keypresses is a good thing, right?
How about you?
What tools do you find super useful when building Node apps? Let me know in the comments! Want to track errors in your Node.js apps? Try Raygun for free today!