
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.
A JavaScript view framework.
Here is a basic example of using Temple. This just uses a simple variable, but Temple has support for most of the major Mustache features.
// create a view instance from a template and data
var tpl = Temple.render("<h1>Hello {{ name }}</h1>", { name: "World" });
// render and append to the document body
tpl.paint("body");
// later, change the value and watch it auto-update the DOM
tpl.data.name = "John";
Listening for DOM events is really easy in Temple. Enable the plugin and then add an on-<event>
attribute to any element.
// create a view instance from just a template
var tpl = Temple.render("<a href='#' on-click='alert'>Click Me</a>")
// enable the DOM events plugin
.use("actions")
// add the special alert action
.addAction("alert", function(e) {
e.original.preventDefault();
alert("You clicked me!");
})
// render and append to the document body
.paint("body");
Temple even lets you turn your views into reusable components.
// a reusable View class
var Hello = Temple.extend({
template: "Hello {{ name }}"
});
// render a new template that uses the view as a partial
var tpl = Temple.render("<h1>{{> hello }}</h1>", { name: "John" })
.setPartial("hello", Hello)
.paint("body");
// views can also be rendered directly
var tpl2 = new Hello({ name: "World" }).paint("body");
FAQs
A JavaScript view framework.
The npm package templejs receives a total of 3 weekly downloads. As such, templejs popularity was classified as not popular.
We found that templejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.