0.1.2 • Published 6 years ago
sfn-pug-engine v0.1.2
Sfn-Pug-Engine
Pug template engine for sfn framework.
For more information about pug, please visit https://pugjs.org/.
Install
npm i sfn-pug-engine
Example
import { HttpController, route } from "sfn";
import { PugEngine } from "sfn-pug-engine";
var engine = new PugEngine();
export default class extends HttpController {
engine: PugEngine = engine;
@route.get("/pug-test")
index() {
return this.view("pug-test.pug");
}
}
API
new PugEngine(options?: PugOptions)
Interface PugOptions
includes:
debug: boolean
Iftrue
, the tokens and function body are logged to stdout.compileDebug: boolean
Iftrue
, the function source will be included in the compiled template for better error messages (default:true
).globals: string[]
Add a list of global names to make accessible in templates.