Crash Course in the Node Debugger

Stop using  console.log in your Node.js code!

If you’re like me, you did JavaScript development in context of the browser before moving over to the server. Using the  console object for debugging is perfectly acceptable. What most new Node developers not realize, is that Node comes with its own debugger that is extremely helpful but not that straightforward to use.

What I hope to do is to give a crash course in using the debugger that will make using the debugger easier and enable you to stop having to use log statements everywhere. Continue reading

Beginner Node.js – Part 4: Architecture Tips

We’ve reached the second half of this beginner Node.js series. YayHopefully at this point, you’re becoming more comfortable with Node, NPM, and pulling in packages. This post starts to get into the meat and potatoes of writing apps using nothing but JavaScript. I’m not going to tell you how you should write apps, but give you some tips and common troubles of architecting an app.

I want to start discussing creating a project and some tips on architecture to make development easier and headaches to a minimum. As I mentioned in the previous post,  npm init is what starts a  package.json for you. That’s the backbone of your project in the sense. It manages dependencies, any extra development dependencies, and metadata about your project that could be used by various other services. Continue reading

Retain Console History using Angular’s $log

I’ve started wrap up on a substantial, Angular project that is now being used in production by customers. Overall, the app is working beautifully and errors are limited. I am recording errors to a server side database and I’ve noticed there’s been ‘digest already in progress‘ errors on one of the views. Although I’ve taken steps to try and get around those issues, I haven’t been able to pinpoint how the user is causing those errors.

I began trying to devise a way to track a user as they interact with the application, then use this information to help debug the errors. After poking around the internet, I wanted to use Angular’s  $log (docs) module to not only write messages to the console, but retain those messages. Then, write them to the server when an error occurs. I figured out that this behavior can be easily added without having to touch the window’s  console object by decorating the  $log module. Continue reading

Top Reads November 2014

This time around I’m going to try and give a bit more context on each of things I want to share. I figured you guys would appreciate that more than just a list of links. I read and find quite a bit that I want other people to be aware of as well. Here are the top reads of articles, libraries, and websites that I found cool or useful for the past month. Enjoy! Continue reading

Beginner Node.js – Part 3: NPM

In the third installment of my beginner Node.js series, we will discuss the Node Package Manager, or NPM for short. If you missed the first two parts, make sure to go back and give them a quick read (part 1, part 2).

If you are familiar with other languages like Ruby or .Net, they come with a form of pulling in contained functionality through package managers. Ruby has its gems, .Net has Nuget, and Python has pip. Even operating systems now have their own package managers with OSX having Homebrew and Windows 10 now having its own.

NPM LogoNode’s is aptly named, Node Package Manager. We will go over the basics and hopefully become more familiar with working with it as it will become a crucial component of creating apps in Node. As of this post, there are currently over 100,000 packages in the NPM repository that are at your fingertips.

Continue reading