An extremely small and lightweight templating framework.
😲 Under 150 LOCs!
🤏 Less than 3 KiB minified script
🧩 No other dependencies
✅ 100% test coverage
- A very small library that can be included without additional dependencies
- Provides clear templating and interpolation
- Extensible functionality through function calling and templates
- Works without any server
- Fast enough to be used in a production environment
- Deterministic output
Get the npm module or import directly from any javascript module:
import pow from 'https://ifyates.github.io/pow.js/latest/pow.min.js'
Looking at CDN hosting soon.
// examples/quickstart.html
<script type="module">
import pow from '../src/pow.js'
const data = {
"url": "https://github.com/IFYates/pow.js",
"title": "pow.js",
"description": "An extremely small and lightweight templating framework.",
"tags": [ "javascript", "templating", "framework" ],
"creation": {
"author": "IFYates",
"date": "2024-12-09"
}
}
pow.apply(document.body, data)
</script>
<h1>{{ title }}</h1>
<h2>{{ description }}</h2>
<p><a href="{{ url }}">See project page</a></p>
<p pow data="creation">
Created by <em>{{ author }}</em> on {{ date }}
</p>
<p>
Tags:
<template pow array="tags">
[<span>{{ $data }}</span>]<span ifnot="$last">, </span>
</template>
</p>