Permalink
Browse files

Added documentation

  • Loading branch information...
1 parent d8c21e9 commit 4ac18dbba5868a9e0dead6dccf2e831387cfd8ae @kriszyp committed Nov 24, 2010
Showing with 27 additions and 1 deletion.
  1. +27 −1 README.md
View
@@ -1,4 +1,30 @@
-CommonJS Utils is a collection of various CommonJS modules.
+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,

0 comments on commit 4ac18db

Please sign in to comment.