jsmart-express

2.0.0 • Public • Published

The jSmart Express

jSmart Express lets you use jSmart (Smarty template engine) and Express (at least version 3) together, including auto-loading partials.

Build Status npm version David David npm

Usage

var jsmartExpress = require('jsmart-express');

// Register '.smarty' extension with The Mustache Express
app.engine('smarty', jsmartExpress());

app.set('view engine', 'smarty');
app.set('views', __dirname + '/views');

Parameters

The mustacheExpress method can take one parameter: the directory of the partials. When a partial is requested by a template, the file will be loaded from path.resolve(directory). By default, these value is determined by Express.

Properties

The return function has a cache parameter that is an LRU Cache.

var engine = jsmartExpress();
var cache = engine.cache; // Caches the full file name with some internal data.

Note that jSmart also has its own cache for partials. You can always use nocache attribute for partials for disbling jSmart cache.

Dependencies (3)

Dev Dependencies (10)

Package Sidebar

Install

npm i jsmart-express

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

9.66 kB

Total Files

5

Last publish

Collaborators

  • umakant