
Company News
Meet the Socket Team at RSAC and BSidesSF 2026
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.
handlebars-require
Advanced tools
Require helper allows for including ephemeral or "components" into your application. Right now it is mostly a experiment to see if this typeof data into Handlebar templates. The api is a bit rough right now but that should be ephemeral as well.
To get the helper injected into your instance of Handlebars require in the module and pass it the current require function and Handlebars.
var
Handlebars = require('handlebars');
require('handlebars-require')(require, Handlebars);
// now you should have the require helper
In the template now you can do this.
{{require './path/to/component'}} {{
-- This is a referance to a js file --}}
<div class="component-container">
{{MyComponent property=value}} {{
-- exported value is based of contructor.name --}}
</div>
Setting ephemeral helper name
{{require './path/to/component' exports="NamedComponent"}}
{{NamedComponent property=value}} {{
-- exports changed the ref --}}
Right now in the simplist form a component is a contructor that has a render function. This is loosly based off of Backbone views.
FAQs
a helper that inject helper components into a template
The npm package handlebars-require receives a total of 0 weekly downloads. As such, handlebars-require popularity was classified as not popular.
We found that handlebars-require demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.

Research
/Security News
Malicious Packagist packages disguised as Laravel utilities install an encrypted PHP RAT via Composer dependencies, enabling remote access and C2 callbacks.

Research
/Security News
OpenVSX releases of Aqua Trivy 1.8.12 and 1.8.13 contained injected natural-language prompts that abuse local AI coding agents for system inspection and potential data exfiltration.