pug-require

2.0.2 • Public • Published

Pug Require

npm

Allows compiling and loading Pug templates via require('./path/to/template.pug').

Installation

$ npm install pug-require

Usage

// Install hooks
const configurePug = require('pug-require');
 
configurePug({ /* pug options */ });
 
// Compile template
const pugTemplateFunction = require('./path/to/template.pug');
 
// Use template
const html = pugTemplateFunction({ /* local variables */ });

API

configurePug(pugOptions)

pugOptions : A Pug options bundle

Regardless of options, attaches the trusted types plugin.

uninstall()

Detaches the Pug hook.

A no-op if not currently installed.

reinstall()

Undoes a call to uninstall.

A no-op if already installed.

Readme

Keywords

Package Sidebar

Install

npm i pug-require

Weekly Downloads

0

Version

2.0.2

License

(MIT OR Apache-2.0)

Unpacked Size

5.4 kB

Total Files

4

Last publish

Collaborators

  • mikesamuel