tezx
TypeScript icon, indicating that this package has built-in type declarations

1.0.67 • Public • Published

TezX - High-Performance JavaScript Framework

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.


🚀 Key Features

  • 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.

📦 Installation

Node.js

npm install tezx
yarn add tezx

Bun

bun add tezx

⚡ Quick Start

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);
});

▶ Running the Server

Node.js

node server.js

For development:

npm install -g nodemon
nodemon server.js

Deno

deno run --allow-net server.ts

Bun

bun run server.js

🛠 Middleware Support

app.use((ctx, next) => {
  console.log(`Incoming request: ${ctx.req.url}`);
  return next();
});

📂 Static File Serving

app.static("/public", "./public");

Files are accessible via /public/filename.ext.


🔀 Routing

app.get("/about", (ctx) => ctx.html("<h1>About Us</h1>"));

app.post("/submit", (ctx) => ctx.json({ message: "Form submitted successfully" }));

⚠️ Error Handling

app.onError((err, ctx) => {
  return ctx.status(500).json({ error: "Internal Server Error" });
});

🧪 Development Setup

Clone and Install

git clone https://github.com/tezxjs/tezx-app-example
cd tezx-app-example
npm install tezx@latest

Run Dev Server

npm run dev

Access at: http://localhost:3000


⚙️ Platform-Specific Scripts

Node.js (Add to package.json)

"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"
}

Bun

"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);
});

Deno

"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);
});

🏗 Build & Deployment

Compile TypeScript to JavaScript

Using tsc:

npm run build

🤝 Contributing

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


💖 Sponsor TezX

TezX is an open-source project built with love and passion. If you find it helpful, consider supporting its development:

Your support helps us maintain and improve TezX for developers around the world. Thank you!

Our Sponsor

papernxt


📜 License

TezX is open-source software licensed under the MIT License.


Package Sidebar

Install

npm i tezx

Weekly Downloads

100

Version

1.0.67

License

MIT

Unpacked Size

322 kB

Total Files

132

Last publish

Collaborators

  • srakib17