microfern
Minimal JavaScript & TypeScript string templating engine that runs anywhere
Microfern uses a simple templating language inspired by Nunjucks. Play around with the interactive example below, or click here to get started.
Template
This is an interactive example for {{ project }}! Change the template and variables to see the output update. When you're ready to get started, click {{ button | titleCase }} above.
Variables
{ "project": "microfern", "button": "get started" }
Output
This is an interactive example for microfern! Change the template and variables to see the output update. When you're ready to get started, click Get Started above.
Edit the template or variables to see the output change.
![runs anywhere](/assets/images/runs-anywhere-9c32e0d6fd7af0cbdbff9860fef18387.png)
runs anywhere
Node.js, browsers (Firefox, Chrome, Safari), Edge functions such as Cloudflare Workers or Vercel Edge Functions, and Bun. All tested with 100% coverage.
![simple but powerful](/assets/images/simple-but-powerful-e6896b560fc288b15cd97c07c7bfe545.png)
simple but powerful
No compilation steps, template inheritance, recursive definitions, or files. Bring your own templates. Get your variables from a map, or write a custom provider. Extend with your own plugin functions.
![minimal](/assets/images/minimal-ab7edd2f537940779674ffc5f79cf1a7.png)
minimal
No dependencies. The core export is under 1kb minzipped, and everything fits within a few kb minzipped. Keep your bundle size small.