📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

express-partial-templates

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-partial-templates

A middleware that will use the views path to create a partials key-value object that makes the file paths of partial templates acessible on the locals property of an HTTP response.

0.2.1
latest
Source
npm
Version published
Weekly downloads
895
39.84%
Maintainers
4
Weekly downloads
 
Created
Source

express-partial-templates

A middleware that will use the views path and the view engine string that are stored against an Express app object to generate a key-value object that identifies and makes accessible the file paths of partial templates against res.locals.partials on execution.

Installation

npm install [--save] express-partial-templates;

Usage

var app = require('express')();

app.set('view engine', 'html');
app.set('views', path.join(__dirname, '/views'));
app.use(require('express-partial-templates')(app));

app.use(function (req, res, next) {
    // res.locals.partials has been set.

    next();
});

Keywords

middleware

FAQs

Package last updated on 15 Jul 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