
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@designble/create-frame
Advanced tools
Easily add private variables to handlebars block helpers.
Easily add private variables to handlebars block helpers.
Install with npm:
$ npm install --save create-frame
var createFrame = require('create-frame');
Create private variables from options hash arguments.
Template
The @post
variable inside the block is created by the post
hash argument. So the context of @post
is the this
object that is passed to the block.
{{#block post=this}}
<h1>{{@post.title}}</h1>
{{/block}}
Helper
The following helper uses createFrame
, then it extends the "frame" with hash arguments.
handlebars.registerHelper('block', function (options) {
var frame = createFrame(options.data);
// extend the frame with hash arguments
frame.extend(options.hash);
return options.fn(options, {data: frame});
});
var fn = handlebars.compile(str);
fn({title: 'My Blog Post'});
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on July 21, 2016.
FAQs
Easily add private variables to handlebars block helpers.
The npm package @designble/create-frame receives a total of 0 weekly downloads. As such, @designble/create-frame popularity was classified as not popular.
We found that @designble/create-frame 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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.