
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
techhead-hogan
Advanced tools
Hogan.js is a compiler for the Mustache templating language. For information on Mustache, see the manpage and the spec.
This is the TECHHEAD fork of Hogan.js. It adds helpers and a few more enhancements and bug fixes.
Here's what's inside: (see test/index.js for ...er, tests... and usage examples)
Hogan.cacheKey()
to consider delimiters (and new options)this
(must use fixMethodCalls
option)index
and array
to method calls made within a list iteration sectionMethod call chaining
var t = Hogan.compile("{{method1.method2.method3}}"),
r = t.render({
method1: function() {
return {
method2: function() {
return {
method3: function() {
return 'test';
}
};
}
};
}
});
// r === "test"
Shorthand close tag and index passed to method call
var t = Hogan.compile("{#names}{^first}, {/}{.}{/names}", { delimeters: '{ }' }),
r = t.render({
names: ['Larry', 'Moe', 'Curly'],
first: function(val, index) {
return (index === 0);
}
});
// r === "Larry, Moe, Curly"
Piped helpers
var t = Hogan.compile("{{ names | join | ucase }}", { fixMethodCalls:1, enableHelpers:1 }),
r = t.render({
names: ['Larry', 'Moe', 'Curly'],
separator: ', ',
join: function(arr) {
return arr.join(this.separator);
},
ucase: function(val) {
return (""+val).toUpperCase();
}
});
// r === "LARRY, MOE, CURLY"
Robert Sayre
Jacob Thornton
Jonathan Hawkes (this fork only)
Copyright 2012 Jonathan Hawkes
Copyright 2011 Twitter, Inc.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
FAQs
A fork of Twitter's mustache compiler.
The npm package techhead-hogan receives a total of 101 weekly downloads. As such, techhead-hogan popularity was classified as not popular.
We found that techhead-hogan 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.