Skip to content
Utility modules for CommonJS
JavaScript
Failed to load latest commit information.
engines/rhino/lib/mail Removed files that are now in promised-io Jul 6, 2010
jsgi moved lib to root Aug 15, 2011
README.md Fixed link again Nov 24, 2010
async.js moved lib to root Aug 16, 2011
base64.js moved lib to root Aug 16, 2011
copy.js
es5-helper.js
extend-error.js
jsgi-client.js moved lib to root Aug 16, 2011
jsgi-worker.js moved lib to root Aug 16, 2011
json-ext.js
json-schema.js moved lib to root Aug 16, 2011
json.js Make json.js usable directly in the browser Oct 14, 2011
lazy-array.js moved lib to root Aug 16, 2011
observe.js moved lib to root Aug 16, 2011
package.json Updated package.json Nov 23, 2010
settings.js Use fs instead of file to work with Ringo Oct 14, 2011
sha1.js moved lib to root Aug 16, 2011
xml-rpc.js moved lib to root Aug 16, 2011

README.md

CommonJS Utils is a collection of various CommonJS modules. Modules include:

extend-error

This module returns a factory for creating custom Error constructors. The extend-error export is a function:

  • ErrorConstructor(name, superError) - Creates a new error constructor. For example:

    MyError = require("commonjs-utils/extend-error")("MyError", Error); ... throw new MyError("something went wrong");

json-ext

This module allows for JSON-style parsing with additional JavaScript constructs like undefined, NaN, Infinity, and dates. The following functions are exported:

  • parse(str) - Parse the provided JSON-style object, array, or primitive literal string.
  • stringify(value) - Encodes the provided value as a JSON-style object, array, or primitive literal.

base64

Provides conversion between JavaScript strings and base64. The base64 module exports:

  • encode(str) - Encode the provided string in base64
  • decode(base64) - Decode a base64 string to a normal string

More extensive information on CommonJS utilities can be found here:

http://www.sitepen.com/blog/2010/03/02/commonjs-utilities/

CommonJS Utils is part of the Persevere project, and therefore is licensed under the AFL or BSD license. The Persevere project is administered under the Dojo foundation, and all contributions require a Dojo CLA.

Something went wrong with that request. Please try again.