🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@frctl/fractal-engine-handlebars

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

@frctl/fractal-engine-handlebars

Handlebars template engine renderer for Fractal

beta
latest
Source
npmnpm
Version
2.0.0-beta.4
Version published
Maintainers
1
Created
Source

Fractal Handlebars engine

Handlebars template engine renderer for Fractal.

Installation & usage

Install into your project via NPM:

npm i @frctl/fractal-engine-handlebars

Then add the engine to your project configuration file:

// fractal.config.js
module.exports = {
  app: {
    //... other config
    engines: [
      '@frctl/fractal-engine-handlebars'
    ]
  }
}

You can then use view.hbs templates in your components.

Customising the Handlebars instance

If you wish to customise the Handlebars instance with helpers, decorators or similar, you can pass a custom Handlebars instance via the engine options.

// fractal.config.js
const hbs = require('handlebars').create();

hbs.registerHelper('myHelper', function(){
  // do something here...
});

module.exports = {
  app: {
    engines: [
      ['@frctl/fractal-engine-handlebars', {
        handlebars: hbs // pass in the custom handlebars instance
      }]
    ]
  }
}

Note: In order to create a custom instance in this way you will need to first install Handlebars via NPM directly into your project: npm i handlebars

Requirements

Requires Node >= v7.6 and Fractal >= v2.0.0-beta.1

FAQs

Package last updated on 03 Nov 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