The JavaScript blog.


libraries prototype audio node browser social graphs

App.net Node Module, Prototype 1.7.1, Self, Qwerty Hancock, MilkChart

Posted on .

App.net Node Module

There's already an App.net Node module: damienklinnert / appdotnet (License: MIT, npm: appdotnet. Created by Damien Klinnert, it uses the popular request HTTP module, and has Mocha tests. It supports authentication, users, and posts.

Creating a post is very simple:

client.createPost(config.post_data, function(err, post) {  
  // Do something with `post`

Prototype 1.7.1

(SFX: Simple Minds - Alive And Kicking)

Prototype 1.7.1 has been released, which includes a rewrite of the DOM code, ECMAScript 5 compatibility, as well as other bug fixes.

Many of you have wondered whether Prototype is "dead," and I can say that it definitely isn't. But because of the way I work on Prototype - months of inaction followed by a flurry of commits and bug fixes - it's fair to say that Prototype hibernates for long periods of time.


Self (License: MIT, npm: self) by Ryan Munro is a class library based on Python. It supports inheritance, mixins, static properties, and can work with plain old prototype classes and Backbone.

Self is class-based sugar that's perfect for continuation-passing style. No more var that = this;! The implicit this variable is changed to an explicit self variable that your inner functions inherit. Self plays nicely with existing prototypal, and Backbone OOP.

Self can be used with browsers and in Node programs, and includes tests for both environments.

Qwerty Hancock

Query Hancock

Qwerty Hancock (GitHub: stuartmemo / qwerty-hancock, License: MIT) by Stuart Memo is a "vector qwerty keyboard". The project's site demonstrates the keyboard by hooking it up to some Audio API code, so it's actually a reusable keyboard widget that could be used to build other music-related projects.


MilkChart (License: MIT) by Brett Dixon is a graph library for MooTools. It generates graphs that look like Excel. It's designed to transform HTML tables into charts, so it's easy to integrate it with existing markup that requires graphs.


graphics prototype zepto languages

Prototype Update, Kaffeine, js-signals, Zepto, rain.js

Posted on .

Prototype 1.7

Prototype 1.7 is out, and activity on has begun already. This is the version of
Prototype that adds Sizzle, \$().on,
Element.Layout, and ES5 compliance.


Kaffeine (License) by Jonah Fox progressively enhances JavaScript while remaining backwards
compatible. The documentation has
examples of the bang syntax, @ alias for this,
implicit brackets and more.

That means code that looks like this:

Edge::add = (nick, name, complete, opts) {
  opts ||= {}
  @client.select 15
  user = User.find! {id: nick}
  puzzle = Puzzle.find! {name: name}
  err, data = client.set! "u:#{user}:p:#{puzzle}"

Will turn into this:

Edge.prototype.add = function(nick, name, complete, opts) {
  opts = opts || {}
  User.find({id: nick}, function(user) {
    Puzzle.find({name: name}, function(puzzle) {
      client.set(("u:" + (user) + ":p:" + (puzzle)), function(err, data) {
        return complete()

The author has outlined his philosophy for the project:

  • Progressive enchancement
  • Concentrate on small useful feature set
  • Hackable, modular, extendable and testable
  • Whitespace is not significant

In case you're wondering, the parser tokenizes

and eval's the result.


js-signals (MIT License) by Miller Medeiros is an event/messaging system for JavaScript:

A Signal is similar to an Event Emitter/Dispatcher or a Pub/Sub system, the main difference is that each event type has it's own controller and doesn't rely on strings to broadcast/subscribe to events. To know more about the differences and advantages/disadvantages of each approach check the Wiki page.

One of the claimed advantages of this project is to favor composition
over inheritance
. This idea appeals to me and the

make it seem simple enough to get started with fairly quickly (should
you need a pub/sub-like messaging system for your next project).

Zepto 0.2

Zepto 0.2
by Thomas Fuchs is out. This version adds support for
Backbone.js which seems like a good fit for the WebKit iOS-app style projects people are
building with it.


Rain.js (MIT License) by Julio Cesar Ody generates a great rain effect,
there's a demo here. As you might have
noticed I'm a sucker for pretty graphical tricks. If you've got any
scene-style JavaScript hacks please send them in!


frameworks prototype

Prototype 1.7

Posted on .

Prototype 1.7 RC1
has been released, which introduces Sizzle for
the selector engine, Element#on,
Element.Layout, and bug fixes.


Sizzle has been on the cards for a long time, but it's actually becoming
a reality. Building Prototype with different selector engines is
possible, including the original, by using Rake:

rake dist SELECTOR_ENGINE=legacy_selector


This is a shortcut for binding events:

$("messages").on('click', 'a.class_name', function(event, element) {
  // Your event code here

This removes a line of code from Prototype 1.6 style code where elements
are extracted from the event.


Prototype now has a consolidated measurement API:

$('elementID').measure('width'); // Integer


ES5 compliance forms a big part of the bug fixes. There are also
performance optimisations. The release is tagged as 1.7rc1 on GitHub,
with a summary of all the changes in the

My Take

These changes are positive -- Element#on makes Prototype
code more concise, and measuring elements has always been slightly
clumsy so the new layout API might have positive repercussions,
particularly for animation and graphics libraries. Thomas Fuchs uses
Prototype for scriptaculous, so this might be a good thing for scripty2
which uses

Finally switching to Sizzle is interesting because it's a widely adopted
and very focused library. There are enough selector engines out there,
so the open source community won't suffer by Prototype's engine becoming

Remember that this means XPath selectors won't work. Prototype supported
XPath in browsers with document.evaluate, but Sizzle will
raise Syntax error, unrecognized expression: