Socket
Book a DemoInstallSign in
Socket

express-handlebars-layouts

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-handlebars-layouts

Just add to your package.json the express-enhancer module

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

Express-Handlebars-Layouts

Usage

You only need to call scanRoutes and pass the directory that contains your routes

var handlebars  = require('express-handlebars'),
    layouts = require('express-handlebars-layouts');

module.exports = function(app){
    var hbs = handlebars.create({
        partialsDir: [
            'templates/partials/'
        ]
    });

    //Register layouts helpers on handlebars
    hbs.handlebars.registerHelper(layouts(hbs.handlebars));

    app.engine('handlebars', hbs.engine);
    app.set('view engine', 'handlebars');
    app.set('views', global.__basedir + '/templates');

    if( global.config.get('handlebars.cache') ){
        app.enable('view cache');
    }
};

FAQs

Package last updated on 30 May 2017

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