tezx 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +147 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# TezX - High-Performance JavaScript Framework
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## 🚀 Key Features
|
|
6
|
+
|
|
7
|
+
- **High Performance:** Optimized for speed and scalability.
|
|
8
|
+
- **Minimal & Intuitive API:** Simple yet powerful.
|
|
9
|
+
- **Built-in Static File Serving:** No additional setup required.
|
|
10
|
+
- **Robust Middleware Support:** Easily extend functionality.
|
|
11
|
+
- **Dynamic & Flexible Routing:** Define routes with ease.
|
|
12
|
+
- **Security First:** Designed with security best practices.
|
|
13
|
+
- **Efficient HTTP Handling:** Built for high concurrency.
|
|
14
|
+
- **Cross-Environment Support:** Works with **Node.js, Deno, and Bun**.
|
|
15
|
+
|
|
16
|
+
## 📦 Installation
|
|
17
|
+
|
|
18
|
+
### Node.js
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install tezx
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or using Yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add tezx
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
<!-- ### Deno
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { TezX } from "https://deno.land/x/tezx/mod.ts";
|
|
34
|
+
``` -->
|
|
35
|
+
|
|
36
|
+
### Bun
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
bun add tezx
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 🚀 Quick Start
|
|
43
|
+
|
|
44
|
+
Create a simple TezX server:
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
import { logger, nodeAdapter, TezX } from "tezx";
|
|
48
|
+
|
|
49
|
+
const app = new TezX({ logger });
|
|
50
|
+
|
|
51
|
+
app.static("/", "./static");
|
|
52
|
+
|
|
53
|
+
app.get("/", (ctx) => {
|
|
54
|
+
return ctx.html(`
|
|
55
|
+
<h1>Welcome to TezX</h1>
|
|
56
|
+
<p>A modern, high-performance cross-environment framework.</p>
|
|
57
|
+
`);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
nodeAdapter(app).listen(3001, (message) => {
|
|
61
|
+
console.log(message);
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## ▶ Running the Server
|
|
66
|
+
|
|
67
|
+
### Node.js
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
node server.js
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
For development with hot-reloading:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm install -g nodemon
|
|
77
|
+
nodemon server.js
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Deno
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
deno run --allow-net server.ts
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Bun
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
bun run server.js
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 🛠 Middleware Support
|
|
93
|
+
|
|
94
|
+
Enhance your application with middleware:
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
app.use((ctx, next) => {
|
|
98
|
+
console.log(`Incoming request: ${ctx.request.url}`);
|
|
99
|
+
return next();
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 📂 Serving Static Files
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
app.static("/public", "./public");
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Access static files via `/public/filename.ext`.
|
|
110
|
+
|
|
111
|
+
## 🔀 Routing
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
app.get("/about", (ctx) => ctx.html("<h1>About Us</h1>"));
|
|
115
|
+
|
|
116
|
+
app.post("/submit", (ctx) => ctx.json({ message: "Form submitted successfully" }));
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## ⚠️ Error Handling
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
app.onError((err, ctx) => {
|
|
123
|
+
return ctx.status(500).json({ error: "Internal Server Error" });
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
<!--
|
|
127
|
+
## 📖 Documentation
|
|
128
|
+
|
|
129
|
+
For full documentation, visit: [TezX Docs](https://tezx.dev/docs) -->
|
|
130
|
+
|
|
131
|
+
## 🤝 Contributing
|
|
132
|
+
|
|
133
|
+
We welcome contributions! Submit issues and pull requests on our GitHub repository.
|
|
134
|
+
<!--
|
|
135
|
+
## 👤 Author
|
|
136
|
+
|
|
137
|
+
**TezX Team**
|
|
138
|
+
📧 Email: <support@tezx.dev>
|
|
139
|
+
🌐 Website: [https://tezx.dev](https://tezx.dev) -->
|
|
140
|
+
|
|
141
|
+
## 📜 License
|
|
142
|
+
|
|
143
|
+
TezX is open-source under the MIT License. See [LICENSE](LICENSE) for details.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
🚀 **TezX - Build fast, scale faster.**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tezx",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "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.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|