Vector Template Engine

The Vector Template Engine is the heart of InertJS. It parses tagged template literals and compiles them dynamically. Since it runs natively in Node.js, there is no build step.

The Anatomy of a View

Every page requires two exports: flux() for server-side logic and data fetching, and render() for generating the HTML.

import { vec } from 'inertjs-vector'; // 1. Fetch data on the server export async function flux() { const name = 'John Doe'; return { name }; } // 2. Render the template export function render({ data }) { return vec` <div class="container"> <h1>Hello, ${data.name}</h1> </div> `; }

Out-of-order Streaming

Vector's superpower is "Flash Mode". If your flux() function takes a long time (e.g., fetching from a slow database), Vector immediately sends the HTML skeleton to the browser, and injects the dynamic data directly into the DOM as soon as the promise resolves!

🚀 Currently in Public Beta (v1.0.0-beta.4) - Help us improve by reporting issues on GitHub.