NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2315 most downloaded on npm
Logic-less {{mustache}} templates with JavaScript
Last release 6 years ago
no release in 18 months
Ships unpredictably
gaps range from 2 weeks to 9 months
Most releases are documented
notes for 22 of 34 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
39 releases · first in 2012
#773 : Add package.json exports field, by @manzt .
Nothing published for this version
Nothing published for this version
One column per quarter.
🚢 bump to version 4.1.0
🚢 bump to version 4.1.0
🚢 bump to version 4.0.1
🚢 bump to version 4.0.1
🚢 bump to version 4.0.0
🚢 bump to version 4.0.0
🚢 bump to version 3.2.1
🚢 bump to version 3.2.1
🚢 bump to version 3.2.0
🚢 bump to version 3.2.0
Nothing published for this version
Added #717 : Added support .js files as views in command line tool, by @JEStaubach . Fixed #716 : Bugfix for indentation of inline partials, by @yotam
🚢 bump to version 3.0.3
🚢 bump to version 3.0.3
Start experimenting & comparing GitHub Actions vs Travis CI, by @phillipj .
#679 : Fix partials not rendering tokens when using custom tags, by @stackchain .
#679: Fix partials not rendering tokens when using custom tags, by @stackchain.
We are very happy to announce a new major version of mustache.js. We want to be very careful not to break projects out in the wild, and adhering to Se
We are very happy to announce a new major version of mustache.js. We want to be very careful not to break projects out in the wild, and adhering to Semantic Versioning we have therefore cut this new major version.
The changes introduced will likely not require any actions for most using projects. The things to look out for that might cause unexpected rendering results are described in the migration guide below.
A big shout out and thanks to @raymond-lam for this release! Without his contributions with code and issue triaging, this release would never have happened.
Writer.prototype.parse to cache by tags in addition to template string, by @raymond-lam.Writer.prototype.parse cache, by @seminaoki.tags parameter to Mustache.render(), by @raymond-lam.We have ensured properties of primitive types can be rendered at all times. That means Array.length, String.length and similar. A corner case where this could cause unexpected output follows:
View:
{
stooges: [
{ name: "Moe" },
{ name: "Larry" },
{ name: "Curly" }
]
}
Template:
{{#stooges}}
{{name}}: {{name.length}} characters
{{/stooges}}
Output with v3.0:
Moe: 3 characters
Larry: 5 characters
Curly: 5 characters
Output with v2.x:
Moe: characters
Larry: characters
Curly: characters
We have improved the templates cache to ensure custom delimiters are taken into consideration for the cache. This improvement might cause unexpected rendering behaviour for using projects actively using the custom delimiters functionality.
Previously it was possible to use Mustache.parse() as a means to set global custom delimiters. If custom
delimiters were provided as an argument, it would affect all following calls to Mustache.render().
Consider the following:
const template = "[[item.title]] [[item.value]]";
mustache.parse(template, ["[[", "]]"]);
console.log(
mustache.render(template, {
item: {
title: "TEST",
value: 1
}
})
);
>> TEST 1
The above illustrates the fact that Mustache.parse() made mustache.js cache the template without
considering the custom delimiters provided. This is no longer true.
We no longer encourage using Mustache.parse() for this purpose, but have rather added a fourth argument to Mustache.render() letting you provide custom delimiters when rendering.
If you still need the pre-parse the template and use custom delimiters at the same time, ensure to provide
the custom delimiters as argument to Mustache.render() as well.
This release is made to revert changes introduced in [2.3.1] that caused unexpected behaviour for several users.
This release is made to revert changes introduced in 2.3.1 that caused unexpected behaviour for several users.
[#643]: Writer.prototype.parse to cache by tags in addition to template string, by [@raymond-lam].
Writer.prototype.parse to cache by tags in addition to template string, by @raymond-lam.Writer.prototype.parse cache, by @seminaoki.Rakefile, by @phillipj.Mustache.parse() return type documentation, by @bbrooks.eslint -> 2.2.0. Breaking changes fix by @phillipj. #548
output argument to mustache CLI, by @wizawu.null lookup when rendering an unescaped value, by @dasilvacontin.Thanks to all the people that contributed to this release! Be it issues, comments, changes.. you are awesome! 🎉 😄
PS: Hope you enjoy the new changelog format! I wanted it to group information in a more useful way, and link to PRs for easy diff viewing. :shipit:
Improve HTML escaping, by @phillipj.
Add Partials support to CLI, by @palkan.
Throw error when providing .render() with invalid template type, by @phillipj.
Mustache global definition (#466) by @yousefcisco.
State that we use semver on the change log, by @dasilvacontin.
version property from bower.json, by @kkirsche.Thanks to our awesome contributors! :)
Added license attribute to package.json, by @pgilad.
:shipit:
Fixed lookup not stopping upon finding undefined or null values, by @dasilvacontin.
undefined or null values, by @dasilvacontin.I'm very happy to see the project moving forward, thanks to all the people who've helped along! It wouldn't be the same :)
Nothing published for this version
Refactor Writer.renderTokens() for better readability, by @phillipj.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →