TezX is a cutting-edge, high-performance, and lightweight JavaScript framework designed for speed, scalability, and flexibility. Built with modern web development needs in mind, TezX enables efficient routing, middleware management, and static file serving with minimal configuration. It is fully compatible with Node.js, Deno, and Bun, making it a truly cross-environment framework.
- ⚡ High Performance – Optimized for speed and scalability.
- 🔥 Minimal & Intuitive API – Simple yet powerful.
- 🗂️ Built-in Static File Serving – No additional setup required.
- 🔌 Robust Middleware Support – Easily extend functionality.
- 🧭 Dynamic & Flexible Routing – Define routes with ease.
- 🔐 Security First – Designed with security best practices.
- 📡 Efficient HTTP Handling – Built for high concurrency.
- 🌍 Cross-Environment Support – Node.js, Deno, and Bun ready.
npm install tezx
yarn add tezx
bun add tezx
import { TezX } from "tezx";
import { logger } from "tezx/middleware";
import { nodeAdapter } from "tezx/adapter";
const app = new TezX();
app.use(logger());
app.static("/", "./static");
app.get("/", (ctx) => {
return ctx.html(`
<h1>Welcome to TezX</h1>
<p>A modern, high-performance cross-environment framework.</p>
`);
});
nodeAdapter(app).listen(3001, (message) => {
console.log(message);
});
node server.js
For development:
npm install -g nodemon
nodemon server.js
deno run --allow-net server.ts
bun run server.js
app.use((ctx, next) => {
console.log(`Incoming request: ${ctx.req.url}`);
return next();
});
app.static("/public", "./public");
Files are accessible via /public/filename.ext
.
app.get("/about", (ctx) => ctx.html("<h1>About Us</h1>"));
app.post("/submit", (ctx) => ctx.json({ message: "Form submitted successfully" }));
app.onError((err, ctx) => {
return ctx.status(500).json({ error: "Internal Server Error" });
});
git clone https://github.com/tezxjs/tezx-app-example
cd tezx-app-example
npm install tezx@latest
npm run dev
Access at: http://localhost:3000
"scripts": {
"clean": "rm -rf dist",
"build:cjs": "tsc --module CommonJS --outDir dist/cjs --removeComments",
"build:esm": "tsc --module ESNext --outDir dist/mjs --removeComments",
"build:dts": "tsc --module ESNext --outDir dist/types --declaration --emitDeclarationOnly",
"build": "npm run clean && npm run build:cjs && npm run build:esm && npm run build:dts",
"start": "node dist/index.js",
"nodemon": "nodemon src/index.ts",
"dev": "tsx watch src/index.ts"
}
"scripts": {
"dev": "bun run --hot --watch src/index.ts"
}
src/index.ts
:
import { bunAdapter } from "tezx/adapter";
bunAdapter(app).listen(3000, (message) => {
console.log(message);
});
"scripts": {
"dev": "deno run --watch --allow-net --allow-read --allow-env --unstable-sloppy-imports src/index.ts"
}
src/index.ts
:
import { denoAdapter } from "tezx/adapter";
denoAdapter(app).listen(3000, (message) => {
console.log(message);
});
Using tsc
:
npm run build
We welcome contributions! Feel free to:
- Fork the repository
- Submit a pull request
- Open an issue for bugs or suggestions
GitHub: https://github.com/tezxjs
TezX is an open-source project built with love and passion. If you find it helpful, consider supporting its development:
- 💸 Become a sponsor on GitHub Sponsors
Your support helps us maintain and improve TezX for developers around the world. Thank you!
TezX is open-source software licensed under the MIT License.