
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 modern JavaScript view framework.
Note: This library is under active development. Use at your own risk!
Download the latest version from our release page and use via a script tag. The variable Temple
will be attached to window
.
<script type="text/javascript" src="temple.js"></script>
If using Browserify or Node.js, you can install via NPM and use via require("templejs")
.
$ npm install templejs
// A simple clock component
var Clock = Temple.Text.extend({
// on init, set the local text value to the current time
constructor: function() {
Temple.Text.call(this, Clock.getTime());
},
// start an interval on mount that will continiously update the time
beforeMount: function(comp) {
this.interval = setInterval(this.invalidate.bind(this), 500);
},
// when the view is unmounted, clear the interval
onStop: function() {
clearInterval(this.interval);
delete this.interval;
},
// updates the value of the text binding to the current time
render: function() {
this.setValue(Clock.getTime());
}
}, {
// a static method that returns the current time as a string
getTime: function() {
var date = new Date;
return [
date.getHours(),
date.getMinutes(),
date.getSeconds()
].map(function(digit) {
return (digit < 10 ? "0" : "") + digit;
}).join(":");
}
});
// render a new instance of clock in the body element
new Clock().paint("body").mount();
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.