View get-field.js
* Universal field getter method for JavaScript objects.
* @param {Object} _path The field path inside `this`.
* @param {...} _default The default value to be returns if field is not found.
* @return {...} Returns the found field value else `_default` else `undefined`.
Object.prototype._ = Object.prototype._ || function(_path, _default) {
var value = _path.split('.').reduce(
function(hash, field) {
return hash && hash[field]
View filter.js
* Demo:
* A generic search algorithm designed for filtering (very) large lists of strings; when an input string
* contains all the parts (words or characters; whitespace is ignored) of the query, spread-out over the text
* then the string is considered to be a match. It works with the way internet browsers (e.g. Firefox, Google
* Chrome) filter address-bar suggestions on user input. It is also quite fast; on my i7 laptop, filtering
* 1) a list of ~23000 items takes around 50ms (yes, milliseconds!);
* 2) a list of ~1 million text items took under 1 second.
* It works both in NodeJS as well as in browser environments (so far I only tested FF and GC).
View class.js
* Class.js: A class factory.
* (
function Class(members) {
// setup proxy
var Proxy = function() {};
Proxy.prototype = (members.base || Class).prototype;
View options.js
/** Command-line options parser (
Copyright 2011 Valeriu Paloş ( All rights reserved.
Released as Public Domain.
Expects the "schema" array with options definitions and produces the
"options" object and the "arguments" array, which will contain all
non-option arguments encountered (including the script name and such).
[«short», «long», «attributes», «brief», «callback»]