ToolkitHelper
TezX DevTools
Developer-friendly diagnostics panel for TezX apps. Inspect routes, middlewares, cookies, environment variables, and add custom debug tabs.
Installation
npm install @tezx/devtools tezx
# or
bun install @tezx/devtools tezx
# or
yarn add @tezx/devtools tezxQuick Usage
import { TezX } from "tezx";
import DevTools from "@tezx/devtools";
const app = new TezX();
app.get("/devtools", DevTools(app, {
// Optional:
// disableTabs: ['cookies', 'routes'],
// extraTabs: (ctx) => [ ... ]
}));Visit: http://localhost:3000/devtools
- Real-time dashboard showing app diagnostics.
Built-in Tabs
| Tab | Description |
|---|---|
routes | Lists all loaded routes with method, path, and source |
middlewares | Shows registered middlewares and their routes |
cookies | Displays request cookies parsed from ctx |
.env | Lists environment variables loaded via .env |
API
DevTools(app: TezX<any>, options?: Options): CallbackOptions
| Option | Type | Description | |
|---|---|---|---|
extraTabs | (ctx) => TabType | Promise<TabType> | Add custom tab panels | |
disableTabs | Array<'cookies' | 'routes'| '.env'| 'middlewares'> | Hide built-in tabs |
Types
type Tab = "cookies" | "routes" | ".env" | "middlewares";
type TabType = {
doc_title: string;
label: string;
tab: Tab | string;
content: string; // Rendered HTML
}[];
type Options = {
extraTabs?: (ctx: Context) => Promise<TabType> | TabType;
disableTabs?: Tab[];
};Radix Router
RadixRouter is a high-performance HTTP router using a radix tree for fast, memory-efficient route matching. It supports static, dynamic, optional, and wildcard routes, with middleware stacking and router composition for modular applications.
TezX LocalFS
LocalFS is a lightweight, runtime-compatible file storage library for Bun applications. It allows you to save, read, delete, and serve files locally with automatic duplicate renaming, MIME type validation, and optional filename sanitization.