Socket
Socket
Sign inDemoInstall

easy-handlebars-js

Package Overview
Dependencies
6
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    easy-handlebars-js

Easy to memorize API to compile handlebars templates on client-side.


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
5.02 MB
Created
Weekly downloads
 

Readme

Source

easy-handlebars-js

npm version

Easy to memorize API to compile handlebars templates on client-side.

Usage

Add your template(s) using script tag:

<script id="my-template" type="text/x-handlebars-template">
  <h1>{{title}}</h1>
</script>

Then, on JavaScript:

const easyHandlebars = require('easy-handlebars');

easyHandlebars('my-template').compile({
  title: 'Hi there!'
});

Why is easyHandlebars simpler?

Check the following comparison:

easyHandlebars API

let compiled = easyHandlebars('my-template').compile({
  title: 'Hi there!'
});

The native Handlebars way

let templateEl = document.querySelector('#my-template');
let templateHtml = templateEl.innerHTML;
let template = Handlebars.compile(templateHtml);

let compiled = template({
  title: 'Hi there!'
});

FAQs

Last updated on 24 May 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc