The JavaScript blog.


hosting node modules npm desktop libraires

Free js.org Subdomains, Wallpaper

Posted on .

Free js.org Subdomains

Stefan Keim wanted to give something back to the JavaScript community, so he's started js.org -- a service that provides free subdomains for JavaScript programmers. You can host your project on GitHub, then point a js.org subdomain at it.

To claim a subdomain you need to do three things:

  1. Create your GitHub Pages-hosted site
  2. Add a CNAME file to your repository with the js.org name that you want
  3. Make a pull request to GitHub: js-org/dns that adds your CNAME to the list

Given how valuable the js.org domain is I think this is very generous of Stefan, and the GitHub-based approach is a nice idea as well.


Sindre Sorhus sent in wallpaper (GitHub: sindresorhus/wallpaper, License: MIT, npm: wallpaper), a module for changing the desktop wallpaper in Mac OS X, Linux, and Windows.

It has a command-line tool (wallpaper [file]) and a Node API:

var wallpaper = require('wallpaper');

wallpaper.set('unicorn.jpg', function(err) {  

wallpaper.get(function(err, imagePath) {  
  //=> '/Users/sindresorhus/unicorn.jpg' 

It would be great to combine this with a Node Canvas module that generates data-driven art, or maybe even using PhantomJS to render a webpage to recreate the joys of Active Desktop!


libraries hosting node modules sponsored-content

EvenNode, Mozaik, Marko

Posted on .


EvenNode is a new hosting service that is dedicated to Node.js. You can get a free app instance which even includes MongoDB, so it's great for quickly deploying MEAN apps. The paid tiers start at €6, which gets you 1GB storage and 256MB RAM. One interesting thing about the paid tiers is they all get unlimited custom domain names, so it's easy to use multiple domain names for each application.


EvenNode supports multiple versions of Node, starting at 0.8.6. You can deploy with Git, and WebSockets are supported out of the box. For more technical details, take a look at the documentation. Sign up only requires an email address and password, so you don't even have to hand over credit card details to try it out!



Mozaik (GitHub: plouc/mozaik, License: MIT, Demo) by Raphaël Benitte is a Node-based web-app for showing dashboards. It includes some widgets for CI and monitoring, but you can add more. It also comes with five themes. Of course, you can create your own widgets and themes.

Other than the very clear and attractive design, one feature that I liked was rotating dashboard layouts. This would be cool if you've got multiple teams in the same office that perform different roles. You could rotate between support information, developer tickets/CI, and server monitoring.

Mozaik is built with React and Express.


Marko (GitHub: raptorjs/marko, License: Apache 2.0, npm: marko) by Patrick Steele-Idem is a templating language for Node and browsers that uses HTML with custom tags. It's being used at eBay as part of their Node stack, and it has been covered by some cool blogs like the StrongLoop blog.

There's a live demo where you can try out the syntax. The markup uses attributes for data binding and iteration, so you can say if="notEmpty(data.colors)" and repeat elements with for="color in data.colors". I haven't seen this syntax before, but I think it would be easy to learn if you're used to declarative template systems.

One thing about Marko that makes a huge amount of sense to me is the fact it's asynchronous. You can stream output with Node's HTTP response objects, which will fit in extremely well with frameworks like Express. The design philosophy statement for Marko says "it should be possible to render HTML out-of-order, but the output HTML should be streamed out in the correct order", and I think this is extremely useful.

The documentation is great and you can extend it with custom tag libraries -- why not try it out now?


hosting node

Node Hosting with Modulus

Posted on .


Modulus.io is a new hosting platform dedicated to Node. Why "platform"? Well, Modulus provides a complete stack for web application development: MongoDB is used for the database and file storage, and WebSockets are supported out of the box. Applications running on the Modulus stack get metrics -- requests are logged and analysed in real-time. Horizontal scaling is supported by running multiple instances of your application.

Pricing is determined by the number of instances (servos) that you run, and storage used. The Modulus pricing page has some sliders, allowing you to see how much it'll cost to run your application per-month.

I asked Modulus about using different versions of Node Node, as Heroku supports 0.4 to 0.10. However, at the time of writing only Node 0.8.15 is supported. Ghuffran Ali from Modulus said that they're working on supporting multiple Node versions as soon as Monday (27th May), so keep an eye on the Modulus blog for details on that.

It's easy to get started with Modulus -- there's a sample project, plus you can sign in with GitHub so it doesn't take too much effort to get a basic application running. They're also offering $15 free credit, so you could run something more substantial there to see how everything works.

Modulus uses a web-based interface for managing projects that allows various settings to be changed, like environmental variables, and a global SSL redirect. There's also a command-line client -- if you sign in with GitHub make sure you use modulus login with -g so you can sign in with your GitHub account.

On a related note, IrisCouch has joined Nodejitsu. That means CouchDB and Redis are now both supported by Nodejitsu:

This means that our users will be able to deploy their applications and databases from the same set of tools all backed by node.js. If you’re an existing IrisCouch user you will be notified and given ample time to migrate your IrisCouch account into a Nodejitsu account.

It's impressive to see so much innovation in the Node hosting/PaaS space!


hosting node browser database iOS indexeddb

Gazel, Heroku Node Versions, nios

Posted on .


Gazel (GitHub: matthewp / gazel, License: MPL 2.0) by Matthew Phillips is a key-value store for browsers, based on Redis. The API is similar to Redis, and has a friendly chainable syntax:

var client = gazel.createClient();

client.on('error', function(err) {  
  console.error('Error:', err);

  .set('key', 1)
  .incrby('key', 10)
  .exec(function(results) {
    var key = results.pop()[0];

It uses IndexedDB for storage, and will attempt to use vendor-specific versions where available. The author has written a sizeable suite of Mocha tests that can be run in a browser.

Heroku Node Version Support

Heroku now permit Node and npm versions to be requested using your application's package.json file:

  "name": "myapp",
  "version": "0.0.1",
  "engines": {
    "node": "0.6.x",
    "npm":  "1.0.x"

The available versions are listed here:

Heroku defaults to their oldest version of Node 0.4, so it's probably a good idea to specify the latest 0.6 version.

Read more here: Specifying a version of Node.js / npm


Node iOS

nios by Sebastian Waisbrot is a Node port for iOS. The objective is to allow Node projects to run on an iOS device with minimal modifications. It uses WebViewJavascriptBridge to run Node's libraries.

The example that comes with the project runs a Node HTTP server within a native iOS app.


hosting node servers ec2 amazon

Node Deployment Recipes

Posted on .

During the publication of our Let's Make a Web
tutorial series, people have
been posting comments about hosting Node apps. In particular, the
comments on Node Tutorial
are quite detailed.
In this article I've summarised Node hosting approaches so you can pick
the approach that suits you.

In the wider web development community there are some amazing
plug-and-play solutions for hosting web apps. Hosting Node apps isn't
quite as easy, yet, but there are some excellent solutions that are both
fast and easy to understand.


Upstart is a replacement for the /sbin/init daemon. You can use it to start, stop, and
restart Node processes. If you're using Ubuntu you should already have
it, if you're using Debian or another Linux distribution it's fairly
easy to install. It actually comes with replacements for the
sysvinit scripts that come with Debian. The Upstart
Getting Started
has more details.

This is an upstart script in /etc/init/myapp.conf that I
knocked up to manage a Node app on EC2:

description "MyApp"
author      "alex"

env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

start on runlevel [23]

    export NODE_ENV=production
    exec /usr/local/bin/node /data/apps/MyApp/app.js 2>&1 >> /var/log/node.log
end script

The respawn
instruction will restart my app if it dies for some reason. There's also
a respawn
which can limit respawning based on a timeout.

On a Debian/Ubuntu server I'd typically use the start,
stop, and status commands to manage this

$ sudo status myapp
myapp start/running, process 9717

Alternative: Monit

I've also used Monit with great success.
Monit can monitor processes and restart them when required. It's
possible to restart a process based on CPU usage or memory.

Monit relies on a PID file, so you may need to write a wrapper script
around your Node app. There's an example in Monit's
. Cluster can write out PID files.

In addition to many other features, Monit can be managed with a web
interface and send out email alerts.


To ease the management of your application further, and potentially
better support multi-core servers,
Cluster can be used. Apps have to be set up to use Cluster, but it's very straightforward.

This is an Express example I've used before on DailyJS:

var app = require('express').createServer(),
    cluster = require('cluster');

app.get('/', function(req, res){
  res.send('hello world');


Cluster has many interesting features, from zero-downtime reloading to a
commnad-line console for real-time administration.

I asked TJ Holowaychuk how he manages production Node apps, and
apparently he's using
Cluster evolved from an older project called Spark, so it seems like
it's got some pedigree.


The age old problem of hosting web software is port 80: binding to this
port requires root. There are ways around this: some firewalls can
redirect traffic from port 80 to a non-privileged port. An alternative
to this is authbind, which can be easily installed in many
distributions. In Debian it's just a case of apt-get install

Once it's installed, create a file in
/etc/authbind/byport/80 and chown it to the
user you want to run your Node app as. Then, if you're using Monit or
Upstart, make sure your Node process is launched with
authbind and run it as that user.

The previous Upstart example would have to be adapted to work with

description "MyApp"
author      "alex"

env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

start on runlevel [23]

    export NODE_ENV=production
    su -c 'authbind /usr/local/bin/node /data/apps/myapp/app.js 2>&1 >> /var/log/node.log' www-data
end script


Almost a year ago I wrote a tutorial on using
nginx to host Node apps. Servers like Apache and nginx can sit in front of your app and the
web. This means you don't need to run on a privileged port, and the web
server can do jobs it's good at like serving static files.

This may fit in better with your current hosting set up. You could still
use a service monitor with Cluster to manage the Node processes.


I deployed my Upstart/Authbind/Cluster combo to EC2 without any trouble
at all. I used the AWS Console to
create EBS storage devices to keep my Mongo database, application, and
static assets. After that it's basic Linux sysadmin.

Just remember to add your IP address and port 22 to the security policy,
else you won't be able to connect!