Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fastify-pug

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-pug

pug integration for fastify

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
94
decreased by-61.63%
Maintainers
1
Weekly downloads
 
Created
Source

fastify-pug

Build Status Greenkeeper badge Coverage Status NPM version JavaScript Style Guide

A plugin for fastify that adds support for the template engine pug.

Install

npm install fastify-pug

Usage

const fastify = require('fastify');
const fastifyPug = require('fastify-pug');

const app = fastify();
app.register(fastifyPug, {views: 'views'});

app.get('/', (request, reply) => {
	reply.render('template.pug');
});

app.listen(3000, (error) => {
	if (error) throw error
})

API

Options

  • views - the relative path to the folder containing the views.
  • fallbackViews (optional) - a fallback directory for the views.
  • filename (optional) - for handling relative includes. Pass in a function like (view: string) => src/${view}

reply.render(view [, locals])

Renders the template from the relative path view. Allows to pass variables to the template via the locals object.

License

MIT License

Keywords

FAQs

Package last updated on 23 Apr 2020

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc