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

circus-handlebars

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

circus-handlebars

Handlebars linker for Circus components

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

circus-handlebars

Implements Handlebars precompilation that is aware of Circus component dependencies when resolving helpers and partials.

Usage

Helpers

Helpers are implemented as simple CommonJS modules and circus-handlebars will handle registration of the helper, utilizing the filename.

module.exports = function() {
  return 'Content';
};

Implements the most basic helper method.

Programatically Loading Modules

Libraries that do not use a particular helper or partial directly may register the object via the partial and helper loaders.

require('helper!./helpers/i18n');
require('partial!./footer');

Will register the i18n helper and footer partial for use in any dependent projects, without having to reference either directly in a template within the hosting component.

Configuration

Used as a preprocessor for the Circus.config method:

var Circus = require('circus'),
    CircusHandlebars = require('circus-handlebars');

var config = {};
config = CircusHandlebars.config(config);
config = Circus.config(config);

circus-handlebars defines optional config values on the handlebars config key. These are:

  • helpersDir: Path to lookup helpers on. All javascript files within this directory are candidates for being automatically linked to helper candidate methods defined within templates. Defaults to ./src/lib/helpers.
  • extension: Extension used to resolve partial names. Defaults to .hbs.
  • knownHelpers: an array of strings defining helpers that are registered via registerHelper manually by libraries that are loaded into the application.

FAQs

Package last updated on 06 Mar 2015

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