Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
grippy committed May 25, 2012
1 parent e4052f0 commit 21776dc
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,24 @@ var express = require('express')
, jade_browser = require('jade-browser')
, app = express.createServer();


// use jade-browser as middleware
app.use(jade_browser.middleware('/js/templates.js', '**', options));

// or configure the file watcher and cacheing
```

Or, configure to add static file caching, instead.

```javascript
var jade_browser = require('jade-browser')

// this will generate a file at this location: staticRoot + '/js/templates.js'
jade_browser.cache('/js/templates.js', '**',
{root: 'some/directory/with/views', staticRoot: __dirname + '/public'});

// or configure the file watcher and add static file caching
if (env === 'development') {
jade_browser.watch('/js/templates.js', '**', options);
jade_browser.watch('/js/templates.js', '**',
{root: 'some/directory/with/views', staticRoot: __dirname + '/public'});
}

```
Expand All @@ -58,7 +70,7 @@ if (env === 'development') {
- `root` The root of the views (default: __dirname)
- `namespace` Namespace for the browser (default: 'jade')
- `minify` Minifies the output (default: false;
If enabled and caching, '-min.js' file is automatically created)
If enabled and using caching, '-min.js' file is automatically created)
- `maxAge` Time in seconds to cache the results (default: 86400)
- `cacheRoot` The file system path where compiled templates are placed ()

Expand Down

0 comments on commit 21776dc

Please sign in to comment.