
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
templater.js
Advanced tools
Dead-simple JavaScript templating with a tiny1 footprint. View the website for extended details & documentation.
Inspired by http://jsforallof.us/2014/12/01/the-anatomy-of-a-simple-templating-engine/ and http://krasimirtsonev.com/blog/article/Javascript-template-engine-in-just-20-line.
1 < 1KB minified + gzipped.
Install the script
The script can be installed with Bower, npm, or by grabbing the latest release from GitHub.
bower install templaterjs # For Bower
npm install templater.js # For npm
Load in the script
If in a browser environment, with a <script> tag
<script src="path/to/templater.min.js"></script>
Or, if in a Node.js environment with a require()
var templater = require("templater.js");
Create the template
<!-- by giving it a non-standard `type` the browser will ignore it -->
<script id="template" type="text/template">
<h1>Hi, I'm {{name}}.</h1>
</script>
Use template and render it against some data
var template = templater(document.getElementById("template").innerHTML),
context = {
name: "Paul"
};
console.log(template(context)); // <h1>Hi, I'm Paul.</h1>
For further documentation and resources, visit the templater.js website.
If you'd like to fork the repo and submit pull request, please feel free.
Check out CONTRIBUTING.md for specifics.
FAQs
Minimal JavaScript templating.
We found that templater.js 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.