Node.js Tutorials
Detect if a GIF is Animated
If you tweet an animated GIF, you'll notice that Twitter takes it and converts it to an mp4. I'd speculate that they do that conversion because an MP4 is better supported across platforms, at least in that they allow for playing/pause of the animation. And with...
Watch Files and Directories with Node.js
Watching a file or directory for changes is an important part of automation. We all enjoy using our favorite CSS preprocessor's "watch" feature -- we can still refresh the page and see our changes as though we were simply writing in pure CSS. Node.js makes both file...
Sync Gulp Tasks with run-sequence
gulp.js is an awesome utility for so many things. I've recently started using gulp as a build tool for the next blog redesign, whenever that may come. In the past I had written my own build scripts but they quickly got messy and I ran into...
Access Intern Command Line Arguments
SitePen's excellent client side testing tool, Intern, comes with an excellent command line utility to run tests and customize how those tests are run. The options provided are great but what if I want to make the command line more dynamic? What if I...
Do a Basic HTTP Request with Node.js
I'm currently working on adding client-side testing to the Mozilla Developer Network (MDN). I'm using Intern, a JavaScript-based WebDriver API created by my former employer SitePen. MDN has used its own Persona login service for years, and since many key features of MDN require...
Force Stack Traces with JavaScript
I recently inherited a Node.js project and man is that scary. The code was well written but whenever you inherit a project you instantly inherit the fear of messing things up. My goal was to fix a fairly routine bug, and finding the issue was fairly easy, but tracing...
Better Compression with UglifyJS
UglifyJS is widely known as the most performant and effective JavaScript minifier available. UglifyJS' default minification with
--compress
is nice but it doesn't do the full job. There are a number of additional directives for thecompress
option, including:sequences
-- join consecutive simple statements using...Install NPM from Command Line
I was trying to update my version of NPM using NPM but long story short, a permissions issue allowed NPM to be removed but not re-installed, and thus I was hosed -- NPM was nowhere to be found on "Walshbook Pro." Eeeek. Well, you can install NPM via...
Look Ma, no CMS!
I hate complexity. And when I say hate I really mean it. When you build websites several years, you start realizing that the simplicity is your best friend. As simple one system is as easy is to develop and maintain it. Nowadays, every...
uncss: Find Unused CSS
You know what's better than adding features to a website or app, from a code perspective? Removing stuff you don't need. Whether it be code, images, or dependencies, getting rid of the crap stale code is like the first sip of a big glass of wine after...