From 9240db10bedb3f5e040fa2af793163a4fbb60f2b Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Sat, 14 Jan 2012 11:07:32 -0800 Subject: [PATCH] Add note about usage in CommonJS --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0b95e68..4de65b9 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,14 @@ In this example, the `Mustache.render` function takes two parameters: 1) the [mustache](http://mustache.github.com/) template and 2) a `view` object that contains the data and code needed to render the template. +### CommonJS + +mustache.js is usable without any modification in both browsers and [CommonJS](http://www.commonjs.org/) +environments like [node.js](http://nodejs.org/). To use it as a CommonJS module, +simply require the file, like this: + + var Mustache = require("mustache"); + ## Templates A [mustache](http://mustache.github.com/) template is a string that contains