@erenthedeveloper0/zen 0.1.0-alpha.1 → 0.1.0-alpha.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.
Files changed (2) hide show
  1. package/README.md +13 -0
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -42,9 +42,22 @@ JavaScript. Stages a route does not use are not emitted at all.
42
42
  - **Deadlines**, **health and readiness endpoints**, **validated configuration**,
43
43
  **content negotiation**, **server-sent events**, **file responses** with
44
44
  `ETag`/`Range`, and **graceful shutdown** that drains before it refuses.
45
+ - **HTML escaped by construction and redirects that stay home**: `ctx.html()`
46
+ takes the `SafeHtml` the `html` tag builds — every interpolation escaped for
47
+ where it sits, a `javascript:` link replaced — and `ctx.redirect()` will not
48
+ leave the origin unless you list where else it may go.
49
+ - **Links asked of the route**: `app.url('users.show', { id })` encodes, types
50
+ and router-checks every value, so a link reaches the route it names — or is
51
+ refused before anyone clicks it.
45
52
  - **Boot-time diagnostics**, aggregated: every registration problem in one run,
46
53
  each with a fix.
47
54
 
55
+ ```ts
56
+ import { html } from '@erenthedeveloper0/zen'
57
+
58
+ app.get('/hello', (ctx) => html`<p>Hello, ${ctx.query['name']}</p>`) // ?name=<script> is text
59
+ ```
60
+
48
61
  ```ts
49
62
  import { zen } from '@erenthedeveloper0/zen'
50
63
  import { z } from 'zod'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erenthedeveloper0/zen",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.3",
4
4
  "description": "Zen: a compiler-first web framework for Node.js. Routing, validation, serialization and the request context are compiled at boot.",
5
5
  "keywords": [
6
6
  "web",
@@ -57,10 +57,10 @@
57
57
  "test": "node --test \"test/**/*.test.ts\""
58
58
  },
59
59
  "dependencies": {
60
- "@erenthedeveloper0/zen-adapter-node": "0.1.0-alpha.1",
61
- "@erenthedeveloper0/zen-core": "0.1.0-alpha.1",
62
- "@erenthedeveloper0/zen-middleware": "0.1.0-alpha.1",
63
- "@erenthedeveloper0/zen-router": "0.1.0-alpha.1"
60
+ "@erenthedeveloper0/zen-adapter-node": "0.1.0-alpha.3",
61
+ "@erenthedeveloper0/zen-core": "0.1.0-alpha.3",
62
+ "@erenthedeveloper0/zen-middleware": "0.1.0-alpha.3",
63
+ "@erenthedeveloper0/zen-router": "0.1.0-alpha.3"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "typescript": ">=5.0"