Skip to main content

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

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

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

minimal

No dependencies. The core export is under 1kb minzipped, and everything fits within a few kb minzipped. Keep your bundle size small.