Node.js Tutorials

  • By
    Convert PSD to PNG with Node.js

    Automating and manipulating media is a fascination of mine, partly because I don't understand the magic behind it and partly because the idea of turning one thing into another is fun and useful.  That latest media tool that has piqued my interest is a JavaScript tool called psd.js. psd.js...

  • By
    Adding ESLint with gulp.js

    I've noticed that I am a loose coder on my personal projects but want some level of decorum on Mozilla and other open source projects.  The more developers you have contributing to a project, the tighter the ship you must keep.  The easiest way to do that is...

  • By
    JavaScript Promise API

    While synchronous code is easier to follow and debug, async is generally better for performance and flexibility. Why "hold up the show" when you can trigger numerous requests at once and then handle them when each is ready?  Promises are becoming a big part of the JavaScript world...

  • By
    Use Promises Instead of Callbacks with promisify-node

    One of the reasons we love promises so much is because they allows us to avoid the infamous callback hell that we've all experienced in these early days of Node.js.  When I see an API that doesn't use the promise pattern, I get annoyed.  Luckily I've found promisify-node, a...

  • By
    Catching Fatal Errors with Node.js child_process

    I'm relatively new to hardcore Node.js hacking so I'm seeing all sorts of lovely new errors that I have no clue how to solve when I initially see them.  To this point I've managed to keep a smile on my face while trying to fix these...

  • By
    Colorful Node.js Message Logging with Chalk

    As you work more and more with Node.js, you start to see the value of good logging, especially to the console.  The problem you run into, however, is that constantly adding logged messages means that the most important messages can get lost in the shuffle.  Info messages should...

  • By
    Managing Node.js Versions with nvm

    A while back I wrote a blog post called Upgrade Node.js with NPM.  The shell commands within that post work great but there were reports in the comments that it could mess with node module paths and such -- a far from ideal situation.  Little did...

  • By
    Convert SVG to PNG

    Earlier this year I became obsessed with different types of media (images, audio, video) and how to convert and merge one format to/with another.  Half of that obsessions is due to fascination in how it's done, the other half is love of performance.  A few of...

  • By
    Access Native Node.js Modules within Intern

    Intern is an awesome unit and functional test suite from SitePen.  I've been using this utility extensively over the past year, writing tests to make sure MDN's front-end is in good shape after code merges and pushes. Sometimes when writing tests I'll want to make use of a node...

  • By
    Intern Concurrency Problem

    Over the past year I've created and implemented Selenium testing on the Mozilla Developer Network using the Intern interface created by SitePen.  Intern's been awesome;  sure there's a learning curve with async JavaScript coding but it's simple when you get the hang of it. One problem I encountered with...