JavaScript Libraries

JavaScript Libraries

Unless otherwise noted, these have been tested in Firefox 1.5, Safari 2.0, and IE 6.


JavaScript collection methods. Provides the functionality of the ECMAScript 1.7 Array extensions, and the Prototype collection methods, in a lightweight form that can be used with other frameworks, including OpenLaszlo.
Functional is a library for functional programming in JavaScript. It defines the standard higher-order functions such as map, filter, and reduce. It defines functions such as curry, rcurry, and partial for partial function application; and compose, guard, and until for function-level programming. It also defines string lambdas, which allow strings such as 'x -> x+1', 'x+1', or '+1' as synonyms for the more verbose function(x) {return x+1}. Source, blog. Demo & docs.

Concurrent JavaScript

Sequentially is a library of temporal and frequency adverbs for JavaScript. It provides methods to queue a function for deferred or periodic execution, and to throttle the rate or number of times that a function can be called. You could think of it as a kind of memoization, where instead of caching the result it modifies when and whether a function is called.
Currently just a partial port of Haskell's MVars, that can each be used to coordinate data flow among periodic functions, and asynchronous callback.

Metaobject Programming

MOP is a short metaobject programming toolkit. It currently contains functions that temporarily replace the methods on an object or class, or that capture calls to a set of methods and replay them later (for asynchronous AJAX). It also defines a function that defines delegating methods.
A construction kit for chained method calls (fluent interfaces), for JavaScript.

jQuery Plugin

jQuery Profile Plugin
Stick this in your page, call $.profile.start() to start profiling calls to $(selector), and then $.profile.done() to stop profiling. It will display statistics for selector calls, by selector. , Source, blog.


JavaScript Gradient Roundrects
Draws gradient roundrects without images. Gradients can be applied procedurally or, via the divstyle library, through CSS. This uses the WHATWG canvas element if it's available, and a stack of div elements otherwise. Source, demo, docs.
Bezier Library
Measure and subdivide beziers, and animate points along a path composed of single or multiple beziers. bezier.js, path.js, demo, blog. (This library also works in OpenLaszlo.)
TextCanvas library
TextCanvas is a wrapper for the WHATWG canvas element, that adds a drawString() method for labeling graphs. Source, docs, demo, blog. This shares the API of the OpenLaszlo textdrawview library.)
A JavaScript implementation of Chris Coyne's Context Free Design Grammar. This one's in progress; I'm slowly plugging away at it.

OpenLaszlo libraries are here. These are written in JavaScript too, but use the OpenLaszlo APIs.