@wooksjs/event-http 0.6.6 → 0.7.1

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 CHANGED
@@ -1,7 +1,5 @@
1
1
  # @wooksjs/event-http
2
2
 
3
- **!!! This is work-in-progress library, breaking changes are expected !!!**
4
-
5
3
  <p align="center">
6
4
  <img src="../../wooks-logo.png" width="450px"><br>
7
5
  <a href="https://github.com/wooksjs/wooksjs/blob/main/LICENSE">
@@ -9,47 +7,17 @@
9
7
  </a>
10
8
  </p>
11
9
 
12
- As a part of `wooks` event processing framework, `@wooksjs/event-http` implements http events and provides composables that let you:
13
-
14
- - parse urls search params
15
- - parse cookies
16
- - parse request body (json, url-encoded, form, ...)
17
- - serve files
18
-
19
- ### The main ideas behind composable functions are:
20
-
21
- 1. Never mutate request object (`req`). Accumulate a request context in a separate object(s) instead (`wooks store`);
22
- 2. Never parse anything (cookies, body) before it is really requested by the request handler;
23
- 3. Get rid of complex predefined data objects containing everything (cookies, headers, body, parsed body etc.) and use composable functions (hooks) instead;
24
- 4. Get rid of tons of dependencies (middlewares) and implement everything that is needed for web app in a simple way.
25
-
26
- ### Official Wooks HTTP composables:
27
-
28
- - [@wooksjs/http-body](https://github.com/wooksjs/wooksjs/tree/main/packages/http-body) - to parse body
29
- - [@wooksjs/http-static](https://github.com/wooksjs/wooksjs/tree/main/packages/http-static) - to serve static files
30
- - [@wooksjs/http-proxy](https://github.com/wooksjs/wooksjs/tree/main/packages/http-proxy) - to proxy requests
10
+ HTTP event processing for the Wooks framework. Provides composables for request parsing, response management, cookies, headers, caching, and more all lazily computed and cached per event.
31
11
 
32
12
  ## Installation
33
13
 
34
- `npm install wooks @wooksjs/event-http`
35
-
36
- ## Quick Start
37
-
38
- ```js
39
- import { useRouteParams } from 'wooks'
40
- import { createHttpApp } from '@wooksjs/event-http'
41
-
42
- const app = createHttpApp()
14
+ ```sh
15
+ npm install @wooksjs/event-http
16
+ ```
43
17
 
44
- app.on('GET', 'hello/:name', () => `Hello ${useRouteParams().get('name')}!`)
18
+ ## Documentation
45
19
 
46
- // shortcuts for some methods are supported:
47
- // app.get('hello/:name', () => `Hello ${ useRouteParams().get('name') }!`)
48
-
49
- app.listen(3000, () => {
50
- console.log('Wooks Server is up on port 3000')
51
- })
52
- ```
20
+ For full documentation, visit [wooks.moost.org/webapp](https://wooks.moost.org/webapp/).
53
21
 
54
22
  ## AI Agent Skills
55
23
 
@@ -57,10 +25,10 @@ This package ships with structured skill files for AI coding agents (Claude Code
57
25
 
58
26
  ```bash
59
27
  # Project-local (recommended — version-locked, commits with your repo)
60
- npx @wooksjs/event-http setup-skills
28
+ npx wooksjs-event-http-skill
61
29
 
62
30
  # Global (available across all your projects)
63
- npx @wooksjs/event-http setup-skills --global
31
+ npx wooksjs-event-http-skill --global
64
32
  ```
65
33
 
66
34
  To keep skills automatically up-to-date, add a postinstall script to your `package.json`:
@@ -68,13 +36,11 @@ To keep skills automatically up-to-date, add a postinstall script to your `packa
68
36
  ```json
69
37
  {
70
38
  "scripts": {
71
- "postinstall": "npx @wooksjs/event-http setup-skills --postinstall"
39
+ "postinstall": "wooksjs-event-http-skill --postinstall"
72
40
  }
73
41
  }
74
42
  ```
75
43
 
76
- This ensures the skill files are refreshed whenever dependencies are installed, without needing a separate command.
77
-
78
- ## Documentation
44
+ ## License
79
45
 
80
- To check out docs, visit [wooks.moost.org](https://wooks.moost.org/webapp/).
46
+ MIT