The JavaScript blog.


libraries node modules mongo filesystem

Node Roundup: mongo-lite, smog, sshfs-node

Posted on .

You can send in your Node projects for review through our contact form or @dailyjs.


mongo-lite (GitHub: alexeypetrushin / mongo-lite, License: MIT, npm: mongo-lite) by Alexey Petrushin aims to simplify MongoDB by removing the need for most callbacks, adding reasonable defaults like safe updates, and offering optional compact IDs.

The chainable API looks more like MongoDB's command-line interface:

var db = require('mongo-lite').connect('mongodb://localhost/test', ['posts', 'comments']);  
db.posts.insert({ title: 'first' }, function(err, post) {  
  // Use post

There's also a Fiber-based API, so it can be used in a synchronous fashion.


smog (License: MIT, npm: smog) from Fractal is a web-based MongoDB interface. It displays collections, and allows them to be sorted and edited. It also supports administration features, like shutting down servers, CPU/bandwidth usage graphs, and replica set management.

It's built with Connect, and there's an experimental GTK+ desktop interface made with the pane module by the same authors.


sshfs-node (License: MIT, npm: sshfs-node) by Charles Bourasseau allows remote filesystems to be mounted using SSH. It uses sshfs and requires keys for authentication, rather than passwords.

It comes with Vows tests, and the same author has also released fs2http.


libraries html5 webgl filesystem

HexGL, one.color, fs.js

Posted on .



HexGL is a WebGL-powered racing game similar in style to WipEout, developed by Thibaut Despoulain. It's built using three.js, and is a pretty solid and fun game. One aspect that impressed me is there's a selector for changing the quality, based on settings tailored for "Mobile", "Mainstream", and "Ultra" -- the author suggests that the game should always run at 60fps.

Thibaut is planning on open sourcing the game, and his blog has a feed so you can stay up to date that way or by following @BKcore on Twitter.


one.color (License: BSD, npm: onecolor) is a browser and Node colour manipulation library. Morgan Roderick suggested this library on Twitter after seeing our jQuery Color coverage, and also pointed out that one of the creators has posted a video about it: Peter Müller: One-color.js.

This library has a chainable API, supports alpha channels and colour names, and has Vows tests to back it all up.


fs.js (License: MIT, npm: fs.js) by Manuel Astudillo is a wrapper for the HTML5 File API, based on Node's fs module. It's got some Mocha unit tests, and supports the use of prefixed file systems:

var sizeInBytes = 1024 * 1024  
  , prefix = 'filetest';

FSFactory.create(sizeInBytes, 'testfs', function(err, fs) {  
  fs.read('foo', function(err, data){
    // data contains file contents.


libraries html5 backbone.js filesystem

LZF Compression, Nekoreader, Backbone.BindTo

Posted on .


LZFjs (GitHub: pkalogiros / LZFjs, License: GPL3) by Pantelis Kalogiros is a compression library based on LibLZF that uses the File API to compress files in client-side JavaScript:

The script is converted from the C version of LZF and works surprisingly fast and well. Both its functions (compress/decompress) accept and return an arraybuffer.

Even though it's been converted from C, the JavaScript is surprisingly easy to follow.


Nekoreader (GitHub: nekoreader / nekoreader.github.com) is a client-side feed reader created by Vincent Grastic. It uses JSONP, and Google's Feed API to handle feeds. It has an API that allows a list of feeds to be specified in a JSON file. A template file and CSS can also be supplied to style the results.

Although people have been using Google's Feed API for a while for similar projects, I like the fact the author's example shows how to configure an entirely client-side app using services like GitHub and Dropbox.


Radoslav Stankov's Backbone.BindTo (License: MIT) is a Backbone.js extension that makes it easier to bind models to views. The author's example compares standard Backbone.js code with his extension:

window.UserCardView = Backbone.View.extend({  
  initialize: function() {
    this.model.bind('change:name',  this.renderName,  this);
    this.model.bind('change:email', this.renderEmail, this);
  remove: function() {
    this.model.unbind('change:name',  this.renderName,  this);
    this.model.unbind('change:email', this.renderEmail, this);
    Backbone.View.prototype.remove.apply(this, arguments);
  renderName:  function() { /* ... code ... */ },
  renderEmail: function() { /* ... code ... */ }

Using Backbone.BindTo makes this feel less like boilerplate:

window.UserCardView = Backbone.View.extend({  
  bindToModel: {
    'change:name':  'renderName',
    'change:email': 'renderEmail'
  renderName:  function() { /* ... code ... */ },
  renderEmail: function() { /* ... code ... */ }

Events will be unbound when views are removed, and there's also Backbone.BindTo.noConflict for using the extension without modifying Backbone.View.

The same author has also recently released Backbone.Handlebars, which helps integrate Backbone.js and Handlebars.js.


libraries html5 webgl filesystem

Meincraft, Virtual Joystick, Filer.js

Posted on .


Meincraft screenshot

Meincraft (GitHub: mitsuhiko / webgl-meincraft, License: BSD) by Armin Ronacher a WebGL demo that generates terrain and allows navigation with its own camera implementation.

It's currently a simple personal project rather than a fully-fledged web-based Minecraft engine, similar to the three.js Minecraft demo, but it's an interesting start and different to the other WebGL Minecraft clones that I've found so far.

Virtual Joystick

Let's Make a 3D Game: Virtual Joystick by Jerome Etienne is a tutorial on his virtualjoystick.js project which provides a joystick suitable for use with touchscreens. It works a lot like the joysticks seen in many iOS and Android games.

The tutorial post includes a demo, and it even works with a mouse. The basic API is simply var joystick = new VirtualJoystick().


Filer.js (GitHub: ebidel / filer.js, License: Apache 2.0) by Eric Bidelman is a friendly API for the HTML5 FileSystem API based around Unix commands. Most commands are asynchronous and expect a callback:

var filer = new Filer();  
filer.init({size: 1024 * 1024}, onInit.bind(filer), onError);

function onInit(fs) {  
  filer.ls('/', function(entries) {
    // entries is an Array of file/directories in the root folder.
  }, onError);

function onError(e) { ... }  

That example lists a directory. Other familiar commands include cd, create, mkdir, rm, cp, mv, open, and write. Each API method is documented in the project's README file in the repository.