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

component-builder-handlebars

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-builder-handlebars

Builder.js plugin to precompile Handlebars templates

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

component-builder-handlebars

Builder.js plugin to precompile Handlebars templates to Component.js modules.

Usage

var handlebarsPlugin = require('component-builder-handlebars');

var builder = new Builder('test/fixtures');  
builder.use(handlebarsPlugin({
  extname: '.hbs',
  partialRegex: /^_/
}));

Or with grunt-component-build:

component: {
  app: {
    output: './build/',
    scripts: true,
    configure: function(builder) {
      builder.use(handlebarsPlugin({
        extname: '.hbs',
        partialRegex: /^_/
      }));
    }
  }
}

Options

extname

Type: String
Default value: .hbs
Define the Handlebars extension name.

partialRegex

Inspired from grunt-contrib-handlebars
Type: RegExp
Default value: /^_/
Define the prefix to identify Handlebars partials.

Example

[componentName/path/to/_navPartial.hbs]

<nav>
  <ul>
  	<li></li>
  	...
  </ul>	
</nav>
[componentName/path/to/myTemplate.hbs]

<h1>{{title}}</h1>
<!-- When you include a partial don't use the prefix -->
{{> componentName/path/to/navPartial}}
[componentName/path/to/module.js]

var myTpl = require('./myTemplate');

var output = myTpl({
  title: 'Ready to start'
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

License

Copyright (c) 2013 Antoine Lehurt
Licensed under the MIT license.

Keywords

FAQs

Package last updated on 21 Mar 2014

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