
Security News
npm Introduces minimumReleaseAge and Bulk OIDC Configuration
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.
handlebars-helper-variable
Advanced tools
Handlebars block helper that adds variables to the context that can be used by following expressions in the same template.
Handlebars block helper that adds variables to the context that can be used by following expressions in the same template.
npm i handlebars-helper-variable --save
var variableHelper = require('handlebars-helper-variable');
Dyanimcally add JSON objects to the context.
context {Object}: Context object to put the JSON object on.Register the helper with Handlebars
var variable = require('handlebars-helper-variable');
var context = {};
Handlebars.registerHelper('variable', variable(context));
Use the helper in a Handlebars template.
{{#variable "foo"}}
{ "foo": "bar" }
{{/variable}}
Compile and render the template with the given context.
Handlebars.compile(template)(context);
//=> context = { foo: { foo: 'bar' } }
Install dev dependencies:
npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Brian Woodward
Copyright (c) 2015 Brian Woodward
Released under the MIT license
This file was generated by verb-cli on March 19, 2015.
FAQs
Handlebars block helper that adds variables to the context that can be used by following expressions in the same template.
The npm package handlebars-helper-variable receives a total of 3 weekly downloads. As such, handlebars-helper-variable popularity was classified as not popular.
We found that handlebars-helper-variable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.

Research
/Security News
Socket uncovered four malicious NuGet packages targeting ASP.NET apps, using a typosquatted dropper and localhost proxy to steal Identity data and backdoor apps.