Prototype JSON APIs with Fortune.js #

If you hadn’t heard, JSON API is a format for building awesome APIs on top of JSON. You can see other posts tagged with JSON API here.

Recently, a new project related to JSON API was released: Fortune.js.

Fortune.js, a web framework for prototyping rich hypermedia APIs, allows you to rapidly prototype the server side of any JSON API api.

Check it out:

var fortune = require('fortune') 
  , app = fortune({ 
    db: 'petstore' 
  .resource('person', { 
    name: String, 
    age: Number, 
    pets: ['pet'] // "has many" relationship to pets 
  .resource('pet', { 
    name: String, 
    age: Number, 
    owner: 'person' // "belongs to" relationship to a person 

This will give you all the proper routes and format the responses in the right way to conform with the spec.

If you didn’t guess, fortune.js makes heavy use of Node, so you can get it from npm:

$ npm install fortune

I am super pumped about projects like this, because it shows off the great benefits of standardizing around a type like JSON API. Tooling that knows how to handle the type makes it really easy to get off the ground.

parallax.js: bringing real movement to the web #

parallax.js is a lightweight parallax engine that responds to the movements from your smartphone’s gyroscope and motion detection. The tool lets you specify depths and directions that determine how your webscape responds to physical movement.

Creating layers is super simple, as documented:

Simply create a list of elements giving each item that you want to move within your parallax scene a class of layer and a data-depth attribute specifying its depth within the scene. A depth of 0 will cause the layer to remain stationary, and a depth of 1 will cause the layer to move by the total effect of the calculated motion.

Parallax.js is useable in jQuery and Zepto as a plugin, too.

MIT Licensed. Browse the source code on Github.

#101: npm origins and Node.js with Isaac Schlueter

Andrew and Adam talk with Isaac Schlueter about the origins of npm, building an asynchronous web with Node.js, and how to get paid to open source. Mastering modern payments using Stripe with Rails. isaacs (Isaac Z. Schlueter) Foo Hack » Isaac Schlueter on Web Development isaacs (izs) on Twitter isaacs/npm Install Node.js and NPM using […]

Write a Date() like a human #

As a person who is constantly thinking about the user’s experience when interacting with my software, writing the date and time using real english such as “2 days from today”, or “tomorrow at 5pm” provides the, often needed, human touch I’m looking for.

Date, from Matthew Mueller, is an english language date parser for node.js and the browser that lets your users write dates like a normal human being using real english.

A few examples from the readme:

date('10 minutes from now')
date('in 5 hours')
date('at 5pm')
date('at 12:30')
date('at 23:35')
date('in 2 days')
date('tuesday at 9am')
date('monday at 1:00am')
date('last monday at 1:00am')
date('tomorrow at 3pm')
date('yesterday at 12:30am')
date('5pm tonight')
date('tomorrow at noon')

Check out the source on GitHub or the homepage for examples and demos.

Lineman helps you build fat-client JavaScript apps #

As more and more web application logic moves into the browser, better tools are needed to manage the front-end development process.

Enter Lineman, which harnesses the power of Node.js and Grunt to compile your assets, run specs when you save files, deploy your app, and perform a host of other helpful tasks for you.

Lineman is a combination productivity tool and build tool. It has templates for many popular JavaScript frameworks (Backbone, Angular, Ember, etc.), and makes testing super easy by including Testem, which is a powerful test runner.

Interested, but not ready to npm install -g lineman quite yet? Check out the demo screencast first!

Lineman — a project by Test Double — is MIT licensed and hosted on GitHub.

#91: Discover Meteor.js with Sacha Greif

Adam Stacoviak and Andrew Thorp talk with Sacha Greif about his new book Discover Meteor, Meteor.js, sustaining open source and more. You can tune-in LIVE on Tuesday’s at 5pm CST. Discover Meteor – Learn how to build real-time JavaScript web apps Telescope, an open-source social news app built with Meteor DiscoverMeteor/Microscope · GitHub Sidebar: […]

Heckle, the Jekyll clone in node.js #

The why:

I like the approach to managing a site taken by Jekyll. A lot.

I don’t like Ruby, and I don’t like strict logic-less templates. Jekyll is Ruby with Liquid as the templating engine.

Heckle is JavaScript with Mold (programmable template extravaganza) as the templating engine.

If you feel how Marijn feels and you don’t like Ruby, or strict logic-less templates — you should checkout Heckle. Marijn also asks that you not use Heckle at this point IF you want something stable and finished. It’s a work in progress.

Check out the source, or learn more about Heckle’s origins.

Moment.js is a Swiss Army Knife for dealing with Time in JavaScript #

Judging from how many stars Moment.js has garnered on GitHub, you may already know about it. But for those who haven’t, Moment.js is Tim Wood’s highly polished and well-documented JavaScript library for parsing, validating, manipulating, and formatting dates.

It runs in the browser or Node.js, supports many languages, has a great API, and has saved this Changelogger countless hours over the years. Here are a few example uses from the project’s homepage:

moment().add('days', 10).calendar();
moment().format("MMM Do YY");

The library weighs in at just 5.5kb and recently reached version 2.0, so if you haven’t looked at it in awhile now’s the time to check it out once again!

Bring your server side debug logging into the browser with Chrome Logger #

If you find yourself jumping back and forth between Chrome’s Dev Tools and a terminal displaying your server side request logs, Craig Campbell’s Chrome Logger might be just the thing you need!

It’s a Chrome extension which lets you see your server side logs right in the browser. There are currently libraries for:

Is your server side language/environment of choice not on that list? Don’t worry, Chrome Logger uses an open and published protocol so you can easily write client libraries of your own!

See the project’s home page for more info or check under the hood if you’re curious about how it all works.

Chart.js — Beautiful client side graphs to visualise your data using HTML5 canvas #


Sexy charts can really make a good data driven UI that much better. One thing that designers struggle with is creating sexy charts and graphs that their developer counterparts can actually implement without having to write it all from scratch.

Chart.js, from Nick Browne, makes it easy to visualize your data using HTML’s <canvas> tag and create great looking charts that are fully customizable. With 6 charts to choose from — you’re able to visualise your data with various animated charts that look great on retina displays too.

Check out the source and the docs to get up to speed. There’s a node port too.

Mantri.js is a new JavaScript Dependency System #

Thanasis Polychronak has released a new JavaScript Dependency System called Mantri. You may be asking yourself, why create yet another JavaScript Dependency System? Well, straight from the home page:

Medium to Large web applications require a robust system to manage their dependencies. While module loaders excel at interoperating with external libraries, they can become difficult to work with when used as dependency systems. A new system should allow the code to be easily tested, debuged and get out of the way after the build process. Meet Mantri!

A few quick points:

  • It leverages Namespaces
  • It’s written in Node and is available in the npm registry
  • There is a grunt plugin (although it’s recommended to install the CLI)
  • Mantri leaves no footprint in production
  • … And more!

Instead of writing up another Getting Started, I would rather point you to the website for Mantri! He did a great job writing a getting started article, as well as documenting the API.

As usual, you can view the homepage or view the source on GitHub.

otr.js: Off The Record Protocol in JavaScript #

Before we talk about otr.js, we have to talk about crypto in JavaScript. It’s important to discuss issues with cryptography, because bugs are much more severe than in ‘normal’ code. If your Rails app has a bug, maybe some emails don’t get sent out. If your crypto has a flow, your secrets are all wide open.

So, before discussing a JavaScript crypto library, I must point you to the first line of the README:

This library hasn’t been properly vetted by security researchers. Do not use in life and death situations!

Furthermore, for more on the issues of crypto and JavaScript specifically, I refer you to this post by Matasano Security, whose opinions I trust when it comes to security.

Okay, now that we’ve got that out of the way, let’s talk about otr.js! OTR is a protocol which allows you to have private conversations over IM. As you may guess, otr.js is an implementation of this protocol in JavaScript.

There’s a lot of setup required, so please read the README, but once you’ve got it set up, it’s pretty easy to use:

var newmsg = "Message to userA."

Not that hard, right? There’s a ton of different options, though they are pretty well-documented. What is odd though, is that apparently messages aren’t encrypted at first; you must call


to make that happen. I believe this is because the OTR protocol itself allows for unencrypted messages, and otr.js seems to be a lower-level library that others will build upon, rather than something you’d use directly.

Why the future of the web is real-time (6 months w/ Meteor)

Special thanks to Sacha Greif for contributing this post. It originally appeared here on The Changelog. When Meteor was first announced in April 2012, the announcement’s Hacker News thread quickly rose to the first spot on the homepage and remained there for a good while. It ended up being one of the site’s most popular […]

Install Node.js and npm using Homebrew on OS X

If you’re looking for an easy to follow guide on installing Node.js and npm on OS X, the default method is to download a pre-built installer for your platform, install it, and make sure it’s on your $PATH. But, if you’re a Homebrew fan like me and prefer to install all of your packages with […]

to-markdown is an HTML to Markdown converter written in JavaScript #

From the readme:

There are a couple of known issues surrounding blockquotes in lists (and perhaps vice versa) — #2; and also how to handle HTML elements outside of the markdown subset (keep them/strip them?) — #3.

But this looks like a useful HTML to Markdown converter written in JavaScript. While this might just be a basic implementation that’s not yet fully bulletproof, creator Dom Christie says, “contributions are welcome.”

Check out the source on GitHub and the hosted demo that lets you paste in HTML and get back the Markdown output.

JWalk, a command-line JSON inspector #

Sometimes inspecting JSON files can be a huge pain, which is exactly why Nate Kohari is created JWalk, a tiny NPM package that makes JSON inspection incredibly simple. First we will need a file to work with, if you don’t have one, simply run this at the command line to get some of our tweets @thechangelog in JSON format.

> curl -G -d count=5 -d include_rts=1 > sample.json

You will need node.js and NPM installed to use JWalk, but the setup process is simple:

> npm -g install coffee-script
> npm -g install jwalk

After installing jwalk, start up an interactive session (using our sample JSON file):

> jwalk sample.json

The command set is limited, but it amounts to exactly what you need for inspection:

  • cd: jump into a specific node
  • ls: view the contents of the current node
  • exit: leave the session

For example, if you want to see the text of the first tweet returned from our cURL:

> cd 0
> cd text
> ls

Bower is a package manager for the web #

I have yet to use this, considering I just found out about this project this evening. I had actually stumbled onto this project after stumbling onto Nicolas Gallagher’s little collection of utility CSS classes called SUIT.

When looking at SUIT, I noticed something different in its installation instructions bower install suit-utils which I found a bit odd cause SUIT is just a CSS library, not a Ruby Gem or something dynamic … so why the CLI install instruction?

Similar to Ruby’s Gemfile or Node’s package.json

Bower is a package manager for the web. But what does that mean? Similar to Ruby’s Gemfile or Node’s package.json, with Bower you can create a component.json file in your project’s root, specifying all of its dependencies.

Right now, when you are managing dependencies in your projects, such as JavaScript libraries, it’s all manual. Bower aims to change that.

Basically, Bower is a generic tool which resolves dependencies and locks down packages to a version. It runs over Git, and is package-agnostic. A package may contain JavaScript, CSS, images, or whatever and it doesn’t rely on any particular transport and lets you easily install those assets and manages dependencies for you.


Bower can install packages by name, Git endpoint, URL or local path. Here are a few examples:

bower install jquery
bower install git://
bower install
bower install ./repos/jquery

Build Status

For more details checkout Bower’s homepage or dive into the source code.

Hyperspider – Declarative HATEOAS API crawler for Node.js #

Interesting project from Jed Schmidt to roll up resources in hypertext APIs:

Give it a list of url patterns, and it will recursively crawl your hypertext HTTP API, streaming back every matching endpoint.

var hyperspider = require("hyperspider")

var options = {
  host: "",
  path: [

hyperspider(options, function(err, data) {
  // data is an array with the result entities of 6 endpoints:
  // 1. /users/jedschmidt
  // 2. /users/jedschmidt/following
  // 3. /users/janl
  // 4. /users/cramforce
  // 5. /users/hblank
  // 6. /users/theophani

Source on GitHub.

Nodefront – Node.js-powered rapid front-end development utility #

Nodefront from Karthik Viswanathan aims to make a front-end developer’s life easier. Built in Node.js, Nodefront bundles a local web server for serving up HTML, CSS, and JavaScript assets and supports live reloading via web sockets. Additionally it ships with a command line interface:

  • nodefront compile – Compiles Jade and Stylus files to HTML and CSS. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.

  • nodefront fetch – Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.

  • nodefront insert – Inserts CSS/JS libraries directly into your HTML or Jade files.

  • nodefront minify – Minifies CSS and JS files. Can also optimize JPG and PNG images.

Karthik has put together a twenty minute screencast for a full demonstration.

Check out the project web site or source on GitHub for more.

Episode 0.8.3 – Cloud 9 IDE with Ruben Daniels and Matt Pardee

Wynn caught up with Ruben and Matt from Cloud 9 to talk about what’s new with their IDE in the cloud. Items mentioned in the show: Ruben Daniels is the CEO of Cloud9. Matt Pardee is a developer & evangelist for Cloud9. Tim Caswell was on a previous episode is an employee at Cloud9. Cloud9 […]

Nodist – Node version manager for Windows #

Nodist from Marcel Klehr aims to be an easy way to switch between Node.js versions on Windows. Inspired by TJ’s n and aiming to improve on nvmw’s global-only switching, Nodist ships with a nice command line interface:


    nodist                         List all installed node versions.
    nodist list
    nodist ls

    nodist <version>               Use the specified node version globally (downloads the executable, if necessary).
    nodist latest                  Use the latest available node version globally (downloads the executable, if necessary).

    nodist add <version>           Download the specified node version.
    nodist + <version>

    nodist run <version> -- <file> Run <file> with the specified node version (downloads the executable, if necessary).
    nodist r <version> -- <file>

    nodist rm <version>            Uninstall the specified node version.
    nodist - <version>

    nodist --help                  Display this help

    nodist -v                      Display nodist version


    nodist 0.8.1                   Use node v0.8.1 globally
    nodist v0.5.10                 Use node v0.5.10 globally
    nodist r 0.8.1 -- foo.js -s    Run `foo.js -s` with node v0.8.1, regardless of the global version
    nodist - 0.5.10                Uninstall node v0.5.10

See the README for installation and usage.

Jam – JavaScript package management for the browser #

Caolan McMahon, the creator of Async, has released a new project called Jam. After using this project for a short while, I can say this project has huge potential. It is a package management tool that allows you to install, use and compile (minify) JavaScript libraries. Jam is a browser-focused project that uses RequireJS (AMD Modules) to load your website’s requirements.

Installation is simple:

npm install -g jamjs

Likewise, installing libraries is easy:

jam install jquery

Finally, you use the RequireJS to include the libraries:

<script src="jam/require.js"></script>
  require(['query'], function($){
    console.log("jQuery loaded!");

One of the coolest features is the compilation, which will package all (optionally a specific set) of your libraries with RequireJS and allow you to load the optimized library as one optimized file.

jam compile jam/compiled.min.js

Then include compiled.min.js instead of require.js, the rest works like before:

<script src="jam/compiled.min.js"></script>
  require(['query'], function($){
    console.log("optimized jQuery loaded!");

If you have a library you would like added as a package, feel free to fork the project and add it in. If, in the process, you run into conflicts or issues with NPM’s package.json, Caolan wants to hear about it!

Head on over to the project page or browse the source on GitHub.