This package has been deprecated

Author message:

Since SFN v0.5, template engines had been replaced with Alar loaders

sfn-pug-engine
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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 If true, the tokens and function body are logged to stdout.
  • compileDebug: boolean If true, 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.

Readme

Keywords

Package Sidebar

Install

npm i sfn-pug-engine

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

7.8 kB

Total Files

7

Last publish

Collaborators

  • ayonli