Tutorials Page 74

  • 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
    Detecting Online Status with JavaScript

    It seems like there's been a huge push in the past year or two to make offline browsing an enjoyable experience with the web;  a large part of that push probably being HTML5 mobile apps, or just web apps in general.  Of course it would be helpful...

  • By
    Exclusive:  10 Free OSCON EU Pavilion Plus Passes!

    O'Reilly Media is holding its first OSCON in Amsterdam next week: October 26-28.  OSCON has been a big hit in the United States and it's exciting to see the conference series make its way to Europe.  There's still time to sign up...

  • By
    Detect Function Argument Names with JavaScript

    I was recently looking over the promisify-node code to see how the author was able to convert basic functions and objects to a promised-based API.  I quickly realized that they were reading function signatures to look for common callback argument names like callback and cb.

  • By
    FileReader API

    As broadband speed continues to get faster, the web continues to be more media-centric.  Sometimes that can be good (Netflix, other streaming services), sometimes that can be bad (wanting to read a news article but it has an accompanying useless video with it).  And every social service does...

  • Media Temple Hosting
  • By
    Focused Image Cropping with smartcrop.js

    Images tend to make any page more engaging, especially when done right.  The problem is that automating image creation and sizing can be a very difficult task, especially when the image is uploaded by a user -- who knows what format, size, and resolution the image will...

  • 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...