DVE started life as the view engine inside Deserve. It was pulled out into its own package so the rendering layer is easier to maintain, lighter to depend on, and free to grow on its own. As a standalone library it now fits far more use cases than a single framework, from full server-rendered apps to edge functions, static builds, email templates, and anywhere else you need safe HTML from data.
DVE turns your HTML templates into finished pages, fast and safely. You write familiar {{ value }} tags, loops, conditionals, and reusable layouts. DVE fills them with your data and hands back ready-to-serve HTML, either as a string or a live stream. It ships as a single tiny package with no dependencies, so the same code runs on your server, at the edge, or straight from a CDN in the browser. And because user data is escaped by default and templates can't run arbitrary code, you get safe-by-default rendering without thinking about it.
If you want simple, predictable HTML rendering that just works everywhere, DVE is for you.
Note
Prerequisites: For Deno (install from deno.com). For npm use Node.js (e.g. nodejs.org).
Deno (JSR):
deno add jsr:@neabyte/dvenpm:
npm install @neabyte/dveCDN (jsDelivr/unpkg/esm.sh):
<scripttype="module">importDVEfrom'https://cdn.jsdelivr.net/npm/@neabyte/dve/dist/index.mjs'</script>Or via esm.sh:
<scripttype="module">importDVEfrom'https://esm.sh/@neabyte/dve'</script>Or via importmap:
<scripttype="importmap">{"imports": {"@neabyte/dve": "https://cdn.jsdelivr.net/npm/@neabyte/dve/dist/index.mjs"}}</script><scripttype="module">importDVEfrom'@neabyte/dve'</script>importDVEfrom'@neabyte/dve'// Create one engine and reuse it across rendersconstdve=newDVE()// Render straight from template text in one callconsthtml=dve.renderString('Hello {{ user?.name ?? "Guest" }}.',{user: {name: 'Ada'}})// html is 'Hello Ada.'// Compile once, then reuse the compiled template for many rendersconstcompiled=dve.compile('{{#each items as item}}{{ item }},{{/each}}')dve.render(compiled,{items: [1,2,3]})// returns '1,2,3,'- Engine - The
DVEclass: options, methods, events, and validation. - Syntax - Template tags: variables, raw output, includes, layouts, conditionals, and loops.
- Expressions - The sandboxed expression language: operators, literals, and member access.
- Editor Extension - Syntax highlighting and snippets for
.dvefiles in VS Code, Cursor, and Trae.
The full index lives in docs/README.md.
npm build (bundles to dist/):
npm run buildType check - format, lint, and type-check:
deno task checkUnit tests - run all tests:
deno task test- Tests live under
tests/(dve, eval, expression, helper, parser, and tokenizer tests).
Performance benchmarks - run with deno bench:
deno task bench- Benchmarks and results live in benchmark/README.md.
This project is licensed under the MIT license. See the LICENSE file for details.