The JavaScript blog.


HTML testing forms node modules middleware sessions connect

Node Roundup: 0.11.3, Busboy, connect-mongostore, Chance

Posted on .

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

Node 0.11.3

Node 0.11.3 was released last week, which was a fairly large update: libuv, c-ares, and v8 were all updated. The debugger now breaks on uncaught exceptions, and there were changes to enable dtrace for libuv's probes (if enabled). The underlying implementation for buffers has undergone major changes as well -- I've picked out a few commits here that discuss the updates:

It looks like these changes should make the buffer implementation more robust. I've checked out Node 0.11.x and 0.10.x on my local machine and run make bench-buffer against both, so far 0.11 doesn't look conclusively faster, but I haven't been particularly scientific about the process yet.


Busboy (GitHub: mscdex / busboy, License: MIT, npm: busboy) by Brian White is a streaming HTML form data parser. It uses the Dicer module to parse multipart fields, and also uses a stream parser for urlencoded fields.

The busboy API allows limits to be placed on the incoming data. The Busboy constructor accepts an options object which may include a limits property. Limits can include fieldNameSize, fieldSize, files, and more -- see the readme for full documentation. These options mostly default to Infinity, apart from fieldNameSize which is 100 bytes.

Tests are included, and it should be possible to use it as Express middleware fairly easily.


How do you decide which session middleware to use? Use cookies during early development then quickly search npm for something that uses your database? Me too! But there are better options out there and it's worth taking a bit of time to research them. Ilya Shaisultanov sent in connect-mongostore (GitHub: diversario / connect-mongostore, License: MIT) which is an attempt to write a cleaner session store that takes advantages of features like replica sets, and has test coverage.



Chance (GitHub: victorquinn / chancejs, License: MIT, npm: chance) by Victor Quinn is a library for generating random stings, numbers, and even things that are useful for test data like address elements and names.

It works in browsers and Node, and has a simple constructor-based API:

var Chance = require('chance');  
var chance = new Chance();  
chance.name({ middle: true });  


animation jquery plugins forms sessions menus

jQuery Roundup: TextExt, Tesselate, Promptumenu, Stellar.js, session.js

Posted on .

Note: You can send your plugins and articles in for review through our contact form or @dailyjs.


TextExt (GitHub: alexgorbatchev / jquery-textext, License: MIT) by Alex Gorbatchev is a modular library for enhancing text inputs. It supports features seen before in similar plugins, like a "tag" style UI, auto-completion, and Ajax, but the difference here is the modular design.

The TextExt plugin itself ships with a set of plugins, like Ajax and Autocomplete, that provide the functionality similar plugins keep in their 'core' code:

    plugins: 'autocomplete',
    autocomplete: {
        dropdownPosition: 'above'

Notice that the API design means the plugin only adds a single entry to jQuery's namespace. All of these plugins are documented in the very thorough TextExt manual.

Nethnic Tesselate


Nethnic Tesselate (License: LGPL) is provides some extremely slick grid-based transition effects. Lots of effects are possible, but I like the one shown in Tesselate Demo 1.


Promptumenu (GitHub: natrixnatrix89 / promptu-menu, License: MIT and GPL) by Janis Zarzeckis displays a grid of icons that can be swiped, like the iOS or Android home screens. The author's examples include grids of various sizes and page indicators.

Usage is pretty simple. Given an unordered list with suitably juicy icons, run promptumenu:

  width: 500,
  height: 500,
  rows: 4,
  columns: 4,
  direction: 'horizontal',
  pages: true


Stellar.js (GitHub: markdalgleish / stellar.js, License: MIT) by Mark Dalgleish adds a parallax scrolling effect to an element as it's scrolled. Try dragging the scroll bar on http://markdalgleish.com/projects/stellar.js to see how this works. It's almost like a 16-bit video game!

The basic usage is simply $.stellar(). Effect options can be supplied by using data attributes, like data-stellar-ratio and data-stellar-background-ratio.


This isn't technically a jQuery plugin, but is a useful bit of client-side scripting nonetheless. session.js (License: MIT) by Iain Nash collects information about the current session, like the screen resolution, geographical location, referrers, cookies, and more. This example by the author shows it being used to conditionally display an alert if the visitor came from Facebook:

<script type='text/javascript'>  
  window.session = {
  options: { gapi_location: true },
  start: function(session){ // can also use window.session global.
    if (session.first_session.visits > 1){
      alert('Hi again from ' + session.location.address.city);
    } else {
      if (session.current_session.referrer_info.host.contains('facebook')){
        alert('Hi there from '+ session.location.address.city +'. How about liking us on facebook?');
      } else if (session.current_session.search.engine){
        alert('Did you find what you were looking for from ' + session.current_session.search.engine + '?');
<script type='text/javascript' src="http://codejoust.github.com/session.js/session-0.4.js"></script>  

It sounds like something that could be used to collect interesting statistics on site visitors, but in the past I've used a similar library of my own creation to enhance bug reports. When people filled out a bug report about my web apps I collected their user agent string, screen size and type, and other information that helped me track down rendering issues. So this library could find a lot of uses with a bit of creativity.