Select Page

Babel and TypeScript Together

tl;dr: If you need to use both Babel-generated and TypeScript-generated files together, make sure both the Babel and Typescript transpilers are targeting the same ES/module technology. Currently, I'm working on a legacy Angular 1 project that's using TypeScript (TS)....

Bash + crontab for periodic URL content checking

Not long ago, I found myself checking a website everyday or so to find out if a particular product became available (in stock). After a handful of times, I thought “why don’t I create a little script to do this for me, and forget about it in the meantime?” Enter bash...

Testing Q Promises in Node.js

Technorati Tags: node.js,testing The code Let’s say you have a Node module (named potentialPartner.js) that returns a promise, as such: [code language="javascript"] var Q = require("q"); function willYouLoveMe(cond){ var deferred = Q.defer(); if (cond ===...

Node.js module testing via rewire

When testing Node modules, one of the challenges you face is dealing with other module dependencies (either third-party modules or your own ones). Let’s say you want to test this module: [sourcecode language="javascript"] var electricSaw =...