fulmine.js 5.21.1 → 5.21.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 +4 -4
- package/package.json +1 -2
- package/src/adopt.js +9 -23
- package/src/application.js +168 -246
- package/src/cli.js +71 -163
- package/src/cluster.js +5 -15
- package/src/compression.js +52 -114
- package/src/create.js +3 -6
- package/src/declarative.js +142 -187
- package/src/hot-settings.js +29 -21
- package/src/index.js +2 -5
- package/src/lazy-readable.js +6 -18
- package/src/lazy-writable.js +5 -16
- package/src/middlewares.js +159 -369
- package/src/nest.js +10 -16
- package/src/node-shim.js +75 -83
- package/src/optimizer.js +68 -153
- package/src/parse-query.js +7 -15
- package/src/request-utils.js +12 -29
- package/src/request.js +268 -406
- package/src/response.js +367 -565
- package/src/route.js +10 -6
- package/src/router-utils.js +124 -249
- package/src/router.js +227 -360
- package/src/server-shape.js +4 -16
- package/src/server-timing.js +2 -14
- package/src/socket.js +23 -6
- package/src/testing.js +19 -44
- package/src/usage.js +49 -22
- package/src/utils.js +173 -379
- package/src/uws.js +6 -8
- package/src/verify.js +20 -39
- package/src/view.js +29 -10
- package/src/walk.js +109 -156
- package/src/websocket.js +4 -7
- package/src/work.js +4 -11
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<img src="./assets/logo-mark.svg" alt="" width="88" align="right">
|
|
2
2
|
|
|
3
|
-
# Fulmine.js: the drop-in Express 5 replacement, up to
|
|
3
|
+
# Fulmine.js: the drop-in Express 5 replacement, up to 22x faster
|
|
4
4
|
|
|
5
5
|
**Fulmine** (lightning in Italian ⚡) is an Express 5 compatible web framework for Node.js, built on
|
|
6
6
|
[µWebSockets.js](https://github.com/uNetworking/uWebSockets.js) instead of `node:http`. Same API, same
|
|
@@ -24,12 +24,12 @@ const express = require("fulmine.js"); // instead of require("express")
|
|
|
24
24
|
|
|
25
25
|
## Why Fulmine
|
|
26
26
|
|
|
27
|
-
- **Faster than Express, measured.** 1.
|
|
28
|
-
7x to
|
|
27
|
+
- **Faster than Express, measured.** 1.2x to 4.5x on plain routing, 1.7x to 5x on a request with a body,
|
|
28
|
+
7x to 22x on a large route table. Routes are matched in C++ by µWS's own router,
|
|
29
29
|
and a simple enough handler is answered without running any JavaScript at all.
|
|
30
30
|
- **Zero rewrite.** `helmet`, `cors`, `passport`, `morgan`, `multer`, `express-session` and the rest of
|
|
31
31
|
the Express ecosystem keep working. Not "mostly": every test runs against real Express first and the
|
|
32
|
-
output must match byte for byte, and Express 5's own test suite passes whole
|
|
32
|
+
output must match byte for byte, and Express 5's own test suite passes whole.
|
|
33
33
|
- **Your framework works too.** NestJS, Next.js, Astro, SvelteKit, React Router, Angular SSR, Apollo
|
|
34
34
|
Server, tRPC, tsoa, MCP servers: each one is served twice in CI, on Express and on Fulmine, and compared.
|
|
35
35
|
- **Ranked in public.** See [HttpArena](https://www.http-arena.com/#sort=rps:-1&q=Js) and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fulmine.js",
|
|
3
|
-
"version": "5.21.
|
|
3
|
+
"version": "5.21.3",
|
|
4
4
|
"description": "Drop-in Express 5 replacement on uWebSockets.js, up to 20x faster. Same API, your middleware and framework keep working.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -164,7 +164,6 @@
|
|
|
164
164
|
"eslint-plugin-sonarjs": "^4.2.0",
|
|
165
165
|
"etag": "^1.8.1",
|
|
166
166
|
"eventsource": "^5.0.0",
|
|
167
|
-
"exit-hook": "^5.1.0",
|
|
168
167
|
"express": "^5",
|
|
169
168
|
"express-art-template": "^1.0.1",
|
|
170
169
|
"express-basic-auth": "^1.2.1",
|
package/src/adopt.js
CHANGED
|
@@ -14,20 +14,10 @@ See the License for the specific language governing permissions and
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
// The commands that edit a config file
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
// a line in a config file:
|
|
22
|
-
//
|
|
23
|
-
// override A framework built on Express requires it in its own code, so there is no specifier
|
|
24
|
-
// to rewrite. Every package manager can answer `express` with this package instead,
|
|
25
|
-
// and each one spells it differently.
|
|
26
|
-
// angular An Angular server bundle is built with esbuild, which inlines every dependency and
|
|
27
|
-
// cannot load uWS's native binary. Two names in `externalDependencies` fix it.
|
|
28
|
-
// pnpm pnpm 10.26 and later refuse a git dependency of a dependency, and µWebSockets.js
|
|
29
|
-
// is one. A direct dependency is allowed, so the project takes it on itself and an
|
|
30
|
-
// override drops the copy this package asks for.
|
|
17
|
+
// The commands that edit a config file, the cases `migrate` cannot reach by rewriting a specifier:
|
|
18
|
+
// override a framework requires express in its own code, so the package manager answers it
|
|
19
|
+
// angular the esbuild server bundle cannot inline uWS's binary, two externalDependencies
|
|
20
|
+
// pnpm pnpm >= 10.26 refuses a git dependency of a dependency, the project takes it on itself
|
|
31
21
|
|
|
32
22
|
"use strict";
|
|
33
23
|
|
|
@@ -78,11 +68,8 @@ function indentOf(source) {
|
|
|
78
68
|
}
|
|
79
69
|
|
|
80
70
|
/**
|
|
81
|
-
* Reads a JSON file, or explains why it could not be read
|
|
82
|
-
*
|
|
83
|
-
* The read is attempted rather than guarded by an existence check: both commands write the file
|
|
84
|
-
* they read, and a check followed by a write to the same path is a race. `code` is what a caller
|
|
85
|
-
* names the missing file by.
|
|
71
|
+
* Reads a JSON file, or explains why it could not be read. No existence check first, a check
|
|
72
|
+
* then a write is a race.
|
|
86
73
|
*
|
|
87
74
|
* @param {string} file
|
|
88
75
|
* @returns {{data: any, source: string}|{error: string, code: string|undefined}}
|
|
@@ -353,10 +340,9 @@ function withPnpmOverride(source) {
|
|
|
353
340
|
/**
|
|
354
341
|
* npx fulmine.js pnpm [dir] [--dry-run]
|
|
355
342
|
*
|
|
356
|
-
* Makes a pnpm project install this package
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* settings from that file only, so package.json's `pnpm` field is not where this goes.
|
|
343
|
+
* Makes a pnpm project install this package: µWebSockets.js as a direct dependency at the pinned
|
|
344
|
+
* spec, and an override in pnpm-workspace.yaml (the only file pnpm 11 reads) dropping the copy
|
|
345
|
+
* this package asks for.
|
|
360
346
|
*
|
|
361
347
|
* @param {string[]} argv everything after the command name
|
|
362
348
|
* @returns {number} exit code
|