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

@pattern-lab/engine-handlebars

Package Overview
Dependencies
Maintainers
7
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pattern-lab/engine-handlebars

The Handlebars engine for Pattern Lab / Node

  • 5.16.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
decreased by-18.05%
Maintainers
7
Weekly downloads
 
Created
Source

The Handlebars PatternEngine for Pattern Lab / Node

To install the Handlebars PatternEngine in your edition, npm install --save @pattern-lab/engine-handlebars should do the trick.

Supported features

  • Includes
  • Lineage
  • Hidden Patterns
  • Pseudo-Patterns
  • Pattern States
  • Pattern Parameters (Accomplished instead using native Handlebars partial arguments)
  • Style Modifiers (Accomplished instead using native Handlebars partial arguments)

Helpers

To add custom helpers or otherwise interact with Handlebars directly, create a file named patternlab-handlebars-config.js in the root of your Pattern Lab project, or override the default location by specifying one or several glob patterns in the Pattern Lab config:

  {
    ...
    "engines": {
      "handlebars": {
        "extend": [
          "handlebars-helpers.js",
          "helpers/**/*.js"
        ]
      }
    }
  }

Each file should export a function which takes Handlebars as an argument.

module.exports = function(Handlebars) {
  // Put helpers here

  Handlebars.registerHelper('fullName', function(person) {
    // Example: person = {firstName: "Alan", lastName: "Johnson"}
    return person.firstName + " " + person.lastName;
  });
};

Keywords

FAQs

Package last updated on 23 Sep 2022

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