Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
create-frame
Advanced tools
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.
We found that 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.