Socket
Socket
Sign inDemoInstall

alar-pug-loader

Package Overview
Dependencies
78
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    alar-pug-loader

Pug loader for Alar framework.


Version published
Weekly downloads
7
Maintainers
1
Install size
8.73 MB
Created
Weekly downloads
 

Readme

Source

Alar-Pug-Loader

Pug loader for Alar framework.

When using this loader, pug files can be loaded as Alar modules and take benefits of auto-loading and hot-reloading.

For information about pug, please visit https://www.npmjs.com/package/pug.

Example

import { ModuleProxy } from "alar";
import { PugLoader } from "alar-pug-loader";

var view = new ModuleProxy("views", __dirname + "/views");

view.setLoader(new PugLoader());

// assume there is hello.pug file in views
// every pug module instance (PugLoader.View) has a render method and accepts an
// argument as data parsed to the template.
view.hello.instance().render({ /* data */ });

API

new PugLoader(options?: PugLoader.Options)

Interface Options includes:

  • encoding?: string Specifies encoding for loading the template (default: utf8).
  • compileDebug: boolean If true, the function source will be included in the compiled template for better error messages (sometimes useful in development). It is enabled by default, unless used with Express in production mode.
  • debug: boolean If true, the tokens and function body are logged to stdout.
  • filters: object Hash table of custom filters. Defaults to undefined.
  • globals: string[] List of global names to make accessible in templates.

Keywords

FAQs

Last updated on 13 Jan 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc