Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

jsmart-express

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsmart-express

Use jSmart (PHP Smarty port in JS) with partials in Express 3.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
9
-40%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

smarty

FAQs

Package last updated on 27 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts