@omkar-sonawane-05/routemap-ir
Type definitions and builders for the RouteMap Intermediate Representation: the JSON metadata
model that describes an Express application's full request lifecycle.
Zero dependencies. Install this if you're writing a RouteMap plugin or consuming ir.json.
npm install --save-dev @omkar-sonawane-05/routemap-ir
import fs from "node:fs";
import type { RouteMapIR, Route, FieldDef } from "@omkar-sonawane-05/routemap-ir";
import { stableStringify, mergeField, routeId } from "@omkar-sonawane-05/routemap-ir";
const ir: RouteMapIR = JSON.parse(fs.readFileSync(".routemap/ir.json", "utf8"));
for (const route of ir.routes) {
console.log(route.method, route.path, route.handler.name);
}
What's in the IR
Each resolved route carries its path, mount chain, ordered lifecycle and security heuristic,
and the model has room for request fields, responses and call-graph data as analyzers fill them in;
each fact tagged with confidence and evidence pointing back at the source.
See the IR specification.
License
MIT