ferrings 0.2.1 → 0.2.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 +114 -140
- package/SECURITY.md +30 -0
- package/ferrings.linux-x64-gnu.node +0 -0
- package/native.js +52 -52
- package/package.json +20 -9
package/README.md
CHANGED
|
@@ -3,80 +3,51 @@
|
|
|
3
3
|
[](https://github.com/avifenesh/ferrings/actions/workflows/ci.yml)
|
|
4
4
|
[](https://github.com/avifenesh/ferrings/actions/workflows/release.yml)
|
|
5
5
|
[](https://www.npmjs.com/package/ferrings)
|
|
6
|
-

|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
Linux `io_uring` TCP transport for Node.js, built
|
|
9
|
+
Usable Linux `io_uring` TCP transport for Node.js services, built in Rust with napi-rs and exposed through a familiar Node-style server API.
|
|
10
10
|
|
|
11
|
-
ferrings
|
|
11
|
+
ferrings gives Node applications a native TCP path outside libuv's epoll networking loop. It owns the listening socket, drives accept/recv/send from a Rust `io_uring` worker, and ships as one npm package with per-platform native packages resolved by npm.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
npm install ferrings
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
```js
|
|
18
|
-
const net = require('node:net');
|
|
19
|
-
const { createTcpServer } = require('ferrings');
|
|
20
|
-
|
|
21
|
-
const server = createTcpServer((connection) => {
|
|
22
|
-
connection.on('data', (data) => connection.end(`ferrings:${data}`));
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
server.listen(0, '127.0.0.1', (info) => {
|
|
26
|
-
const client = net.createConnection(info.port, info.host, () => client.write('ping'));
|
|
27
|
-
client.on('data', (data) => {
|
|
28
|
-
console.log(data.toString());
|
|
29
|
-
server.close();
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Save the example as `quickstart.js` and run it with `node quickstart.js`; it prints `ferrings:ping`.
|
|
35
|
-
|
|
36
|
-
## Quick proof signals
|
|
13
|
+
## Performance
|
|
37
14
|
|
|
38
|
-
|
|
39
|
-
- CI builds and tests Node 20, 22, and 24 on Linux.
|
|
40
|
-
- Uses the napi-rs root-package + optional-native-package pattern: one JS API package for users, matrix-built native packages underneath.
|
|
41
|
-
- `npm run check:release-ready -- --full --strict` verifies the local release gates; ZCRX hardware proof is optional unless `--require-zcrx` is set.
|
|
42
|
-
- Package install smoke tests pack the tarball, install it in a temporary app, start a TCP server through `require('ferrings')`, and run the installed CLI.
|
|
15
|
+
The benchmark scripts ship in this repo and in the npm package. This run was measured on 2026-06-28 on an Intel Core Ultra 9 275HX laptop, Linux `7.0.0-22-generic`, Node `v26.4.0`, npm `11.17.0`, Rust `1.96.0`, and the default 8 MiB locked-memory limit. It is a loopback benchmark under `strace -f -c`; absolute numbers are machine-specific, but the same-host comparison is the point.
|
|
43
16
|
|
|
44
|
-
|
|
17
|
+
| Case | req/s | p99 ms | server syscalls/conn | Path |
|
|
18
|
+
| --- | ---: | ---: | ---: | --- |
|
|
19
|
+
| Node `http` | 2,673 | 67.245 | 11.781 | libuv/epoll |
|
|
20
|
+
| ferrings HTTP | 4,118 | 40.127 | 6.181 | `io_uring` accept/recv + provided buffer ring |
|
|
21
|
+
| Node `net` TCP echo | 3,650 | 26.580 | 11.075 | libuv/epoll |
|
|
22
|
+
| ferrings native TCP echo | 8,277 | 22.718 | 5.140 | native echo worker + provided buffer ring |
|
|
23
|
+
| ferrings TCP facade | 7,565 | 24.311 | 6.935 | Node-style JS facade + batched native events |
|
|
24
|
+
| ferrings TCP facade batch send | 6,694 | 25.849 | 6.890 | JS facade + batched native events/sends |
|
|
45
25
|
|
|
46
|
-
|
|
47
|
-
- Use this when you need a Node API over a Rust-native networking worker for high-concurrency Linux experiments.
|
|
48
|
-
- Use this when you want runtime visibility into kernel features such as multishot recv, provided buffer rings, recv-bundle, zero-copy send, and ZCRX readiness.
|
|
49
|
-
- Use this when you want to benchmark syscall counts, tail latency, and queue behavior without building a native addon from scratch.
|
|
50
|
-
- Use this when you are exploring ZCRX, but want the broadly usable core to work on machines without ZCRX-capable NIC hardware.
|
|
26
|
+
In this run, ferrings HTTP delivered 1.54x Node HTTP throughput with 48% fewer server syscalls per completed connection. The native TCP echo path delivered 2.27x Node `net` throughput with 54% fewer server syscalls. The Node-style TCP facade still crosses into JavaScript, but it stayed ahead of the Node baseline while keeping the application API ergonomic.
|
|
51
27
|
|
|
52
|
-
##
|
|
53
|
-
|
|
54
|
-
Install the published package:
|
|
28
|
+
## Install
|
|
55
29
|
|
|
56
30
|
```bash
|
|
57
31
|
npm install ferrings
|
|
58
32
|
```
|
|
59
33
|
|
|
60
|
-
|
|
34
|
+
Requirements:
|
|
61
35
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
```
|
|
36
|
+
- Linux
|
|
37
|
+
- Node.js `>=22`
|
|
38
|
+
- A target supported by the published native packages: `linux-x64-gnu`, `linux-x64-musl`, `linux-arm64-gnu`, or `linux-arm64-musl`
|
|
39
|
+
|
|
40
|
+
CI currently tests Node 22, 24, and 26 on Linux.
|
|
68
41
|
|
|
69
|
-
## Quick
|
|
42
|
+
## Quick Start
|
|
70
43
|
|
|
71
|
-
|
|
44
|
+
Create `quickstart.js`:
|
|
72
45
|
|
|
73
46
|
```js
|
|
74
47
|
'use strict';
|
|
75
48
|
|
|
76
49
|
const net = require('node:net');
|
|
77
|
-
const { createTcpServer
|
|
78
|
-
|
|
79
|
-
console.log(capabilities());
|
|
50
|
+
const { createTcpServer } = require('ferrings');
|
|
80
51
|
|
|
81
52
|
const server = createTcpServer((connection) => {
|
|
82
53
|
connection.on('data', (data) => {
|
|
@@ -93,8 +64,6 @@ server.listen(
|
|
|
93
64
|
useZeroCopySend: true
|
|
94
65
|
},
|
|
95
66
|
(info) => {
|
|
96
|
-
console.log(`listening on tcp://${info.host}:${info.port}`);
|
|
97
|
-
|
|
98
67
|
const client = net.createConnection({ host: info.host, port: info.port }, () => {
|
|
99
68
|
client.write('hello');
|
|
100
69
|
});
|
|
@@ -117,43 +86,32 @@ Run it:
|
|
|
117
86
|
node quickstart.js
|
|
118
87
|
```
|
|
119
88
|
|
|
120
|
-
|
|
89
|
+
It prints `echo:hello`. Your application handles normal JavaScript callbacks; ferrings handles the listening socket, multishot receive path, sends, and shutdown on the native worker.
|
|
121
90
|
|
|
122
|
-
|
|
123
|
-
- `capabilities()` printed the active kernel probes for this host.
|
|
124
|
-
- `useRecvBundle` and `useZeroCopySend` were requested, but remain capability-gated by the native addon.
|
|
125
|
-
- The client received `echo:hello` and the server shut down.
|
|
91
|
+
## Why Use It
|
|
126
92
|
|
|
127
|
-
|
|
93
|
+
- Use ferrings when you want a real Node TCP server API backed by Linux `io_uring` instead of libuv's epoll networking path.
|
|
94
|
+
- Use ferrings when syscall count, tail latency, and high connection concurrency matter enough to justify a Linux native dependency.
|
|
95
|
+
- Use ferrings when you want runtime counters for multishot accept/recv, provided buffer rings, recv-bundle, zero-copy send, registered-buffer send probes, and ZCRX readiness.
|
|
96
|
+
- Use ferrings when you want Rust-native networking work while keeping application code, callbacks, packaging, and deployment in Node.js.
|
|
97
|
+
- Use ferrings when you are preparing for ZCRX-capable NICs but need the broadly useful multishot/provided-buffer path to work on ordinary recent kernels.
|
|
128
98
|
|
|
129
|
-
|
|
99
|
+
## Core Model
|
|
130
100
|
|
|
131
|
-
|
|
101
|
+
ferrings is not a wrapper around Node's `net.Server`. It creates the listening socket directly with `socket`, `bind`, and `listen`, then drives accepts, receives, sends, and shutdown from a Rust worker thread with `io_uring`.
|
|
132
102
|
|
|
133
|
-
|
|
134
|
-
- JS to native writes go through a bounded command queue and an `eventfd` wakeup.
|
|
135
|
-
- Server counters are exposed through `info()` and the initial `ServerInfo` returned by `start()` / `listen()`.
|
|
136
|
-
- Kernel-specific features are probed at runtime instead of assumed.
|
|
103
|
+
JavaScript still owns the application surface:
|
|
137
104
|
|
|
138
|
-
|
|
105
|
+
- Native-to-JS events are delivered through NAPI thread-safe callbacks.
|
|
106
|
+
- JS-to-native writes go through a bounded command queue and an `eventfd` wakeup.
|
|
107
|
+
- The Node-style facade exposes `connection`, `data`, `close`, `write()`, `end()`, `destroy()`, `address()`, and `getConnections()`.
|
|
108
|
+
- Lower-level APIs expose connection IDs, batched events, batched sends, server counters, and active capability probes.
|
|
139
109
|
|
|
140
|
-
|
|
110
|
+
The default receive path is multishot accept + multishot recv + provided buffers. ZCRX is separate and explicitly gated because it needs kernel support, NIC header/data split, RX queue setup, flow steering or RSS isolation, and permissions.
|
|
141
111
|
|
|
142
|
-
|
|
143
|
-
- Raw `UringTcpServer` for lower-level event handling, batched event delivery, and batched sends.
|
|
144
|
-
- `UringTcpEchoServer` for native TCP echo benchmarks without per-connection JS callbacks.
|
|
145
|
-
- `UringHttpServer` for fixed-response HTTP benchmarks on the cleanest `io_uring` path.
|
|
146
|
-
- Multishot accept and recv for fewer per-operation submissions on supported kernels.
|
|
147
|
-
- Provided buffer rings first, with `IORING_OP_PROVIDE_BUFFERS` fallback when registration is rejected.
|
|
148
|
-
- Optional recv-bundle mode using `IORING_FEAT_RECVSEND_BUNDLE` when the kernel advertises it.
|
|
149
|
-
- Optional zero-copy send using `IORING_OP_SEND_ZC`, with counters for requests, notifications, copied fallback, and errors.
|
|
150
|
-
- Optional registered-buffer send path, guarded by an active startup probe.
|
|
151
|
-
- Optional ZCRX path with `zcrxProbe()`, CLI diagnostics, active IFQ registration probe, and hardware smoke tests.
|
|
152
|
-
- Bounded command, event, and per-connection send queues so overload is reported instead of growing memory without bound.
|
|
112
|
+
## APIs
|
|
153
113
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
### Node-style TCP
|
|
114
|
+
### Node-Style TCP
|
|
157
115
|
|
|
158
116
|
```js
|
|
159
117
|
const { createTcpServer } = require('ferrings');
|
|
@@ -167,9 +125,9 @@ server.listen(0, '127.0.0.1', (info) => {
|
|
|
167
125
|
});
|
|
168
126
|
```
|
|
169
127
|
|
|
170
|
-
Use this
|
|
128
|
+
Use this for a familiar Node server shape over the native transport.
|
|
171
129
|
|
|
172
|
-
### Raw TCP
|
|
130
|
+
### Raw TCP Events
|
|
173
131
|
|
|
174
132
|
```js
|
|
175
133
|
const { UringTcpServer } = require('ferrings');
|
|
@@ -190,9 +148,9 @@ const info = server.start((event) => {
|
|
|
190
148
|
console.log(`tcp://${info.host}:${info.port}`);
|
|
191
149
|
```
|
|
192
150
|
|
|
193
|
-
Use this
|
|
151
|
+
Use this when you want direct event objects and explicit connection IDs.
|
|
194
152
|
|
|
195
|
-
### Batched TCP
|
|
153
|
+
### Batched TCP Events And Sends
|
|
196
154
|
|
|
197
155
|
```js
|
|
198
156
|
const { UringTcpServer } = require('ferrings');
|
|
@@ -214,9 +172,9 @@ const info = server.startBatch((events) => {
|
|
|
214
172
|
console.log(`tcp://${info.host}:${info.port}`);
|
|
215
173
|
```
|
|
216
174
|
|
|
217
|
-
Use this
|
|
175
|
+
Use this when JS callback overhead matters and events can be processed in batches.
|
|
218
176
|
|
|
219
|
-
### Fixed-
|
|
177
|
+
### Fixed-Response HTTP
|
|
220
178
|
|
|
221
179
|
```js
|
|
222
180
|
const { UringHttpServer } = require('ferrings');
|
|
@@ -232,9 +190,9 @@ const info = server.start();
|
|
|
232
190
|
console.log(`http://${info.host}:${info.port}`);
|
|
233
191
|
```
|
|
234
192
|
|
|
235
|
-
`UringHttpServer` is
|
|
193
|
+
`UringHttpServer` is for fixed-response endpoints and transport measurements. It is not an HTTP framework.
|
|
236
194
|
|
|
237
|
-
### Native
|
|
195
|
+
### Native TCP Echo
|
|
238
196
|
|
|
239
197
|
```js
|
|
240
198
|
const { UringTcpEchoServer } = require('ferrings');
|
|
@@ -249,9 +207,9 @@ const info = server.start();
|
|
|
249
207
|
console.log(`tcp://${info.host}:${info.port}`);
|
|
250
208
|
```
|
|
251
209
|
|
|
252
|
-
Use this to isolate the native TCP
|
|
210
|
+
Use this to isolate the native TCP path from JavaScript event delivery.
|
|
253
211
|
|
|
254
|
-
|
|
212
|
+
## Capabilities And Doctor
|
|
255
213
|
|
|
256
214
|
```js
|
|
257
215
|
const { capabilities, zcrxProbe } = require('ferrings');
|
|
@@ -265,7 +223,7 @@ console.log(zcrxProbe({
|
|
|
265
223
|
}));
|
|
266
224
|
```
|
|
267
225
|
|
|
268
|
-
The installed CLI exposes the same
|
|
226
|
+
The installed CLI exposes the same checks:
|
|
269
227
|
|
|
270
228
|
```bash
|
|
271
229
|
npx ferrings capabilities --json
|
|
@@ -297,7 +255,7 @@ Common server options:
|
|
|
297
255
|
| `useRegisteredSendBuffer` | `false` | all servers | Requests fixed-buffer send mode. |
|
|
298
256
|
| `useZeroCopyReceive` | `false` | all servers | Requests ZCRX; requires capable hardware and permissions. |
|
|
299
257
|
|
|
300
|
-
TCP
|
|
258
|
+
TCP queue options:
|
|
301
259
|
|
|
302
260
|
| Option | Default | Purpose |
|
|
303
261
|
| --- | ---: | --- |
|
|
@@ -310,31 +268,29 @@ TCP-only queue options:
|
|
|
310
268
|
|
|
311
269
|
All servers expose live counters through `ServerInfo`, including accepted/closed/rejected connections, bytes sent/received, queue drops, receive buffer starvations, recv-bundle counters, zero-copy send counters, fixed-send misses, and ZCRX packet counters.
|
|
312
270
|
|
|
313
|
-
##
|
|
314
|
-
|
|
315
|
-
### Snapshot: loopback syscall benchmark
|
|
271
|
+
## Reproduce The Benchmarks
|
|
316
272
|
|
|
317
|
-
|
|
273
|
+
Run the README table:
|
|
318
274
|
|
|
319
275
|
```bash
|
|
320
276
|
REQUESTS=1000 CONCURRENCY=64 QUEUE_DEPTH=64 BUFFER_COUNT=512 BUFFER_SIZE=2048 \
|
|
321
277
|
CASES=node-http,ferrings-http,node-tcp,ferrings-native-tcp,ferrings-tcp-facade,ferrings-tcp-facade-batch \
|
|
322
|
-
REPORT_PATH=artifacts/benchmark-readme-2026-06-28.json \
|
|
278
|
+
REPORT_PATH=artifacts/benchmark-readme-node26-2026-06-28.json \
|
|
323
279
|
npm run bench:syscalls
|
|
324
280
|
```
|
|
325
281
|
|
|
326
|
-
|
|
327
|
-
| --- | ---: | ---: | ---: | ---: | ---: | --- |
|
|
328
|
-
| Node `http` | 2,689 | 19.536 | 63.368 | 75.987 | 11.620 | libuv/epoll |
|
|
329
|
-
| ferrings HTTP | 5,547 | 10.480 | 28.965 | 33.123 | 5.645 | multishot accept/recv + provided buffer ring |
|
|
330
|
-
| Node `net` TCP echo | 4,086 | 14.881 | 19.244 | 26.649 | 10.987 | libuv/epoll |
|
|
331
|
-
| ferrings native TCP echo | 8,128 | 6.353 | 16.562 | 20.422 | 5.842 | native echo worker + provided buffer ring |
|
|
332
|
-
| ferrings TCP facade | 7,001 | 7.199 | 30.371 | 33.890 | 8.149 | JS facade + batched native events |
|
|
333
|
-
| ferrings TCP facade batch send | 8,451 | 6.188 | 24.787 | 28.451 | 7.143 | JS facade + batched native events/sends |
|
|
282
|
+
Full table from that run:
|
|
334
283
|
|
|
335
|
-
|
|
284
|
+
| Case | req/s | p50 ms | p95 ms | p99 ms | server syscalls/conn | Path |
|
|
285
|
+
| --- | ---: | ---: | ---: | ---: | ---: | --- |
|
|
286
|
+
| Node `http` | 2,673 | 19.886 | 55.742 | 67.245 | 11.781 | libuv/epoll |
|
|
287
|
+
| ferrings HTTP | 4,118 | 12.891 | 31.286 | 40.127 | 6.181 | `io_uring` accept/recv + provided buffer ring |
|
|
288
|
+
| Node `net` TCP echo | 3,650 | 16.051 | 24.966 | 26.580 | 11.075 | libuv/epoll |
|
|
289
|
+
| ferrings native TCP echo | 8,277 | 6.408 | 18.805 | 22.718 | 5.140 | native echo worker + provided buffer ring |
|
|
290
|
+
| ferrings TCP facade | 7,565 | 7.366 | 22.139 | 24.311 | 6.935 | JS facade + batched native events |
|
|
291
|
+
| ferrings TCP facade batch send | 6,694 | 8.626 | 21.719 | 25.849 | 6.890 | JS facade + batched native events/sends |
|
|
336
292
|
|
|
337
|
-
|
|
293
|
+
Other benchmark commands:
|
|
338
294
|
|
|
339
295
|
```bash
|
|
340
296
|
npm run bench
|
|
@@ -350,7 +306,7 @@ Benchmark scripts:
|
|
|
350
306
|
- `benchmark/tcp-echo.js` compares Node TCP, the ferrings TCP facade, raw TCP, native echo, recv-bundle, and zero-copy-send variants when available.
|
|
351
307
|
- `benchmark/high-concurrency.js` runs HTTP and TCP cases with higher concurrency defaults.
|
|
352
308
|
- `benchmark/syscalls.js` uses `strace -f -c` when installed to report server-side syscalls per completed connection.
|
|
353
|
-
- `benchmark/first-slice.js` writes one compact validation report
|
|
309
|
+
- `benchmark/first-slice.js` writes one compact validation report across capabilities, HTTP, TCP, and syscall cases.
|
|
354
310
|
|
|
355
311
|
Set `REPORT_PATH=artifacts/<name>.json` to keep machine-readable reports. Useful knobs include `DURATION_MS`, `REQUESTS`, `CONCURRENCY`, `QUEUE_DEPTH`, `BUFFER_COUNT`, `BUFFER_SIZE`, `CASES`, and `SYSCALL_CASES`. If you raise `BUFFER_COUNT`, `QUEUE_DEPTH`, or fixed send-buffer counts, raise `ulimit -l` / `RLIMIT_MEMLOCK` too.
|
|
356
312
|
|
|
@@ -367,18 +323,45 @@ ZCRX_INTERFACE=eth0 ZCRX_CONNECT_HOST=<nic-routed-host> npm run test:zcrx
|
|
|
367
323
|
|
|
368
324
|
For a real NIC receive proof, avoid `127.0.0.1`; route packets through the selected NIC queue, usually from a second host or a network namespace.
|
|
369
325
|
|
|
370
|
-
##
|
|
326
|
+
## Packages
|
|
371
327
|
|
|
372
|
-
The
|
|
328
|
+
The root package is Linux-only and depends on target-specific optional native packages. A normal install picks the one package that matches the current machine.
|
|
373
329
|
|
|
374
|
-
|
|
375
|
-
- Published native packages:
|
|
376
|
-
- `ferrings-linux-x64-gnu`
|
|
377
|
-
- `ferrings-linux-x64-musl`
|
|
378
|
-
- `ferrings-linux-arm64-gnu`
|
|
379
|
-
- `ferrings-linux-arm64-musl`
|
|
330
|
+
Published packages:
|
|
380
331
|
|
|
381
|
-
|
|
332
|
+
- `ferrings`
|
|
333
|
+
- `ferrings-linux-x64-gnu`
|
|
334
|
+
- `ferrings-linux-x64-musl`
|
|
335
|
+
- `ferrings-linux-arm64-gnu`
|
|
336
|
+
- `ferrings-linux-arm64-musl`
|
|
337
|
+
|
|
338
|
+
Source development:
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
git clone https://github.com/avifenesh/ferrings.git
|
|
342
|
+
cd ferrings
|
|
343
|
+
npm install
|
|
344
|
+
npm test
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Project Health
|
|
348
|
+
|
|
349
|
+
- npm package: [`ferrings`](https://www.npmjs.com/package/ferrings)
|
|
350
|
+
- Examples: [`examples/http-fixed.js`](examples/http-fixed.js), [`examples/tcp-echo.js`](examples/tcp-echo.js)
|
|
351
|
+
- Benchmarks: [`benchmark/`](benchmark/)
|
|
352
|
+
- Type surface: [`index.d.ts`](index.d.ts), [`native.d.ts`](native.d.ts)
|
|
353
|
+
- CLI entrypoint: [`bin/ferrings.js`](bin/ferrings.js)
|
|
354
|
+
- CI workflow: [`.github/workflows/ci.yml`](.github/workflows/ci.yml)
|
|
355
|
+
- Release workflow: [`.github/workflows/release.yml`](.github/workflows/release.yml)
|
|
356
|
+
- Security workflow: [`.github/workflows/security.yml`](.github/workflows/security.yml)
|
|
357
|
+
- Security policy: [`SECURITY.md`](SECURITY.md)
|
|
358
|
+
- Tests: [`test/`](test/)
|
|
359
|
+
|
|
360
|
+
There is no separate docs site yet; the README, type definitions, examples, benchmarks, and tests are the current reference material.
|
|
361
|
+
|
|
362
|
+
## Release Checks
|
|
363
|
+
|
|
364
|
+
Useful checks before cutting a release:
|
|
382
365
|
|
|
383
366
|
```bash
|
|
384
367
|
npm run check:native-packages
|
|
@@ -388,31 +371,19 @@ npm run check:release-ready -- --full --strict
|
|
|
388
371
|
npm run check:release-ready -- --full --require-zcrx
|
|
389
372
|
```
|
|
390
373
|
|
|
391
|
-
Tag pushes that match the package version build all native artifacts, run package checks, and publish to npm with the repository `NPM_TOKEN` secret. Manual `workflow_dispatch` runs can also publish when `publish=true`. For a new release, bump the package version first; npm versions are immutable after publication.
|
|
374
|
+
Tag pushes that match the package version build all native artifacts, run package checks, and publish to npm with the repository `NPM_TOKEN` secret. Manual `workflow_dispatch` runs can also publish when `publish=true`. For a new release, bump the package version first; npm versions are immutable after publication, so `check:release-ready` is a release gate rather than a normal post-release main-branch check.
|
|
392
375
|
|
|
393
|
-
## Limitations
|
|
376
|
+
## Limitations
|
|
394
377
|
|
|
395
378
|
- Linux only; there is no macOS or Windows transport.
|
|
396
|
-
- Node.js `>=
|
|
379
|
+
- Node.js `>=22` is required.
|
|
397
380
|
- This is a native addon, so kernel support and process limits affect which fast paths are active.
|
|
398
|
-
- The TCP facade
|
|
399
|
-
- `UringHttpServer` is a fixed-response
|
|
381
|
+
- The TCP facade follows the common Node server shape, but it is not a drop-in replacement for every `net.Server` behavior.
|
|
382
|
+
- `UringHttpServer` is a fixed-response server, not an HTTP application framework.
|
|
400
383
|
- TLS is not implemented.
|
|
401
384
|
- ZCRX requires specific NIC hardware, kernel support, queue setup, permissions, and routed traffic through the selected RX queue.
|
|
402
385
|
- Registered-buffer send can be unavailable even when the kernel supports other modern `io_uring` networking features; ferrings reports that through `capabilities().registeredSendBuffer`.
|
|
403
|
-
-
|
|
404
|
-
|
|
405
|
-
## Docs, examples, and project health
|
|
406
|
-
|
|
407
|
-
- Examples: [`examples/http-fixed.js`](examples/http-fixed.js), [`examples/tcp-echo.js`](examples/tcp-echo.js)
|
|
408
|
-
- Benchmarks: [`benchmark/`](benchmark/)
|
|
409
|
-
- Type surface: [`index.d.ts`](index.d.ts), [`native.d.ts`](native.d.ts)
|
|
410
|
-
- CLI entrypoint: [`bin/ferrings.js`](bin/ferrings.js)
|
|
411
|
-
- Release workflow: [`.github/workflows/release.yml`](.github/workflows/release.yml)
|
|
412
|
-
- CI workflow: [`.github/workflows/ci.yml`](.github/workflows/ci.yml)
|
|
413
|
-
- Tests: [`test/`](test/)
|
|
414
|
-
|
|
415
|
-
There is no separate docs site yet; the README, type definitions, examples, and tests are the current reference material.
|
|
386
|
+
- This is a `0.x` package; API names and defaults may change between minor releases.
|
|
416
387
|
|
|
417
388
|
## Contributing
|
|
418
389
|
|
|
@@ -421,16 +392,19 @@ Issues and pull requests are welcome. There is no standalone `CONTRIBUTING.md` y
|
|
|
421
392
|
```bash
|
|
422
393
|
npm install
|
|
423
394
|
npm test
|
|
424
|
-
npm run
|
|
395
|
+
npm run audit:deps
|
|
396
|
+
npm run check:pack
|
|
425
397
|
```
|
|
426
398
|
|
|
427
399
|
For changes that touch native packaging, also run:
|
|
428
400
|
|
|
429
401
|
```bash
|
|
430
402
|
npm run check:native-packages
|
|
431
|
-
npm
|
|
403
|
+
npm run check:pack
|
|
432
404
|
```
|
|
433
405
|
|
|
406
|
+
For type-surface changes, `npm test` runs `npm run test:types`, which compiles a consumer TypeScript smoke test against the published `.d.ts` entrypoints.
|
|
407
|
+
|
|
434
408
|
For ZCRX changes, include `npm run test:zcrx` output when you have access to capable hardware. If you do not, include `node bin/ferrings.js zcrx-probe --all --active --json` output so reviewers can see the blocker.
|
|
435
409
|
|
|
436
410
|
## License
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
ferrings is pre-1.0. Security fixes are shipped on the latest published npm version only.
|
|
6
|
+
|
|
7
|
+
| Version | Supported |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| latest `0.x` | Yes |
|
|
10
|
+
| older `0.x` | No |
|
|
11
|
+
|
|
12
|
+
## Reporting A Vulnerability
|
|
13
|
+
|
|
14
|
+
Please report suspected vulnerabilities through GitHub private vulnerability reporting for this repository:
|
|
15
|
+
|
|
16
|
+
https://github.com/avifenesh/ferrings/security/advisories/new
|
|
17
|
+
|
|
18
|
+
If private reporting is unavailable, open a GitHub issue with minimal public detail and ask for a private contact path. Do not include exploit payloads, secrets, host-specific identifiers, or active target details in a public issue.
|
|
19
|
+
|
|
20
|
+
## What To Include
|
|
21
|
+
|
|
22
|
+
- A short description of the impact.
|
|
23
|
+
- Affected package version and platform target.
|
|
24
|
+
- Kernel, Node.js, and Linux distribution versions when relevant.
|
|
25
|
+
- Minimal reproduction steps or a small test case.
|
|
26
|
+
- Whether the issue requires local code execution, untrusted network input, special NIC capabilities, or elevated permissions.
|
|
27
|
+
|
|
28
|
+
## Response Expectations
|
|
29
|
+
|
|
30
|
+
The maintainer will acknowledge valid reports as quickly as practical, confirm the affected surface, and coordinate a patched npm release when needed. For dependency advisories, the project runs npm and RustSec audits in CI and on a weekly schedule.
|
|
Binary file
|
package/native.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('ferrings-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('ferrings-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.2.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
80
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('ferrings-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('ferrings-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.2.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
96
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('ferrings-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('ferrings-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.2.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
117
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('ferrings-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('ferrings-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.2.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
133
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('ferrings-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('ferrings-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.2.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
150
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('ferrings-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('ferrings-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.2.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
166
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('ferrings-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('ferrings-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.2.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
185
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('ferrings-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('ferrings-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.2.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
201
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('ferrings-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('ferrings-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.2.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
217
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('ferrings-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('ferrings-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.2.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
237
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('ferrings-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('ferrings-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.2.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
253
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('ferrings-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('ferrings-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.2.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
274
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('ferrings-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('ferrings-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.2.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
290
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('ferrings-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('ferrings-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.2.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
308
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('ferrings-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('ferrings-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.2.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
324
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('ferrings-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('ferrings-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.2.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
342
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('ferrings-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('ferrings-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.2.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
358
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('ferrings-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('ferrings-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.2.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
376
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('ferrings-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('ferrings-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.2.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
392
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('ferrings-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('ferrings-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.2.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
410
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('ferrings-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('ferrings-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.2.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
426
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('ferrings-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('ferrings-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.2.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
443
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('ferrings-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('ferrings-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.2.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
459
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('ferrings-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('ferrings-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.2.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
479
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('ferrings-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('ferrings-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.2.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
495
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('ferrings-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('ferrings-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.2.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
511
|
+
if (bindingPackageVersion !== '0.2.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ferrings",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Linux io_uring TCP transport
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "Linux io_uring TCP transport for Node.js services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"files": [
|
|
27
27
|
"README.md",
|
|
28
|
+
"SECURITY.md",
|
|
28
29
|
"LICENSE-APACHE",
|
|
29
30
|
"LICENSE-MIT",
|
|
30
31
|
"index.js",
|
|
@@ -41,8 +42,9 @@
|
|
|
41
42
|
"scripts": {
|
|
42
43
|
"build": "napi build --platform --js native.js --dts native.d.ts --release",
|
|
43
44
|
"build:debug": "napi build --platform --js native.js --dts native.d.ts",
|
|
44
|
-
"test": "npm run test:rust && npm run build:debug && node test/zcrx-hardware-smoke.js --self-test && node test/zcrx-gate.js && node test/cli-smoke.js && node test/smoke.js && node test/zero-copy-send.js && node test/http-registered-send-buffer.js && node test/recv-bundle.js && node test/tcp-registered-send-buffer.js && node test/tcp-command-queue.js && node test/tcp-event-queue.js && node test/tcp-send-queue.js && node test/connection-limit.js && node test/listen-backlog.js && node test/reuse-port.js && node test/tcp-defer-accept.js && node test/connection-idle-timeout.js && node test/transport-stats.js && node test/tcp-transport.js && node test/tcp-batch-transport.js && node test/tcp-transport-facade.js && node test/tcp-nodelay.js && node test/socket-buffer-size.js && node test/first-slice-benchmark.js && node test/package-install-smoke.js && node test/platform-package-install-smoke.js && node test/tcp-send-batch.js && node test/tcp-send-and-close.js && node test/tcp-half-close.js && node test/tcp-zero-copy-send.js && node test/tcp-zero-copy-send-heap.js && node test/tcp-native-echo-zero-copy-heap.js && node test/tcp-zero-copy-send-and-close.js && node test/tcp-zero-copy-shutdown.js && node test/tcp-native-echo.js && node test/idle-shutdown.js && node test/concurrency-regression.js",
|
|
45
|
+
"test": "npm run test:rust && npm run test:types && npm run build:debug && node test/zcrx-hardware-smoke.js --self-test && node test/zcrx-gate.js && node test/cli-smoke.js && node test/smoke.js && node test/zero-copy-send.js && node test/http-registered-send-buffer.js && node test/recv-bundle.js && node test/tcp-registered-send-buffer.js && node test/tcp-command-queue.js && node test/tcp-event-queue.js && node test/tcp-send-queue.js && node test/connection-limit.js && node test/listen-backlog.js && node test/reuse-port.js && node test/tcp-defer-accept.js && node test/connection-idle-timeout.js && node test/transport-stats.js && node test/tcp-transport.js && node test/tcp-batch-transport.js && node test/tcp-transport-facade.js && node test/tcp-nodelay.js && node test/socket-buffer-size.js && node test/first-slice-benchmark.js && node test/package-install-smoke.js && node test/platform-package-install-smoke.js && node test/tcp-send-batch.js && node test/tcp-send-and-close.js && node test/tcp-half-close.js && node test/tcp-zero-copy-send.js && node test/tcp-zero-copy-send-heap.js && node test/tcp-native-echo-zero-copy-heap.js && node test/tcp-zero-copy-send-and-close.js && node test/tcp-zero-copy-shutdown.js && node test/tcp-native-echo.js && node test/idle-shutdown.js && node test/concurrency-regression.js",
|
|
45
46
|
"test:rust": "cargo test",
|
|
47
|
+
"test:types": "tsc -p tsconfig.types.json",
|
|
46
48
|
"test:zcrx": "npm run build:debug && node test/zcrx-hardware-smoke.js",
|
|
47
49
|
"artifacts": "napi artifacts --output-dir artifacts --npm-dir npm && node scripts/copy-native-package-assets.js",
|
|
48
50
|
"prepublishOnly": "node scripts/prepublish.js",
|
|
@@ -51,11 +53,14 @@
|
|
|
51
53
|
"check:npm-names": "node scripts/check-npm-names.js",
|
|
52
54
|
"check:npm-new-names": "node scripts/check-npm-names.js --require-new-names",
|
|
53
55
|
"check:github-repository": "node scripts/check-github-repository.js",
|
|
56
|
+
"check:metadata": "node scripts/check-package-metadata.js",
|
|
54
57
|
"check:release-repository": "node scripts/check-release-repository.js",
|
|
55
58
|
"check:release-ready": "node scripts/check-release-ready.js",
|
|
56
59
|
"configure:release-repository": "node scripts/configure-release-repository.js",
|
|
57
60
|
"check:platform-install": "node test/platform-package-install-smoke.js",
|
|
61
|
+
"check:pack": "npm pack --dry-run --json",
|
|
58
62
|
"check:publish": "npm publish --dry-run --json",
|
|
63
|
+
"audit:deps": "npm audit --audit-level=moderate && cargo audit",
|
|
59
64
|
"bench": "node benchmark/compare.js",
|
|
60
65
|
"bench:first-slice": "node benchmark/first-slice.js",
|
|
61
66
|
"bench:tcp": "node benchmark/tcp-echo.js",
|
|
@@ -65,13 +70,15 @@
|
|
|
65
70
|
"example:tcp": "node examples/tcp-echo.js"
|
|
66
71
|
},
|
|
67
72
|
"devDependencies": {
|
|
68
|
-
"@napi-rs/cli": "^3.7.2"
|
|
73
|
+
"@napi-rs/cli": "^3.7.2",
|
|
74
|
+
"@types/node": "^26.0.1",
|
|
75
|
+
"typescript": "^6.0.3"
|
|
69
76
|
},
|
|
70
77
|
"optionalDependencies": {
|
|
71
|
-
"ferrings-linux-arm64-gnu": "0.2.
|
|
72
|
-
"ferrings-linux-arm64-musl": "0.2.
|
|
73
|
-
"ferrings-linux-x64-gnu": "0.2.
|
|
74
|
-
"ferrings-linux-x64-musl": "0.2.
|
|
78
|
+
"ferrings-linux-arm64-gnu": "0.2.3",
|
|
79
|
+
"ferrings-linux-arm64-musl": "0.2.3",
|
|
80
|
+
"ferrings-linux-x64-gnu": "0.2.3",
|
|
81
|
+
"ferrings-linux-x64-musl": "0.2.3"
|
|
75
82
|
},
|
|
76
83
|
"napi": {
|
|
77
84
|
"binaryName": "ferrings",
|
|
@@ -83,11 +90,15 @@
|
|
|
83
90
|
]
|
|
84
91
|
},
|
|
85
92
|
"engines": {
|
|
86
|
-
"node": ">=
|
|
93
|
+
"node": ">=22"
|
|
87
94
|
},
|
|
88
95
|
"os": [
|
|
89
96
|
"linux"
|
|
90
97
|
],
|
|
98
|
+
"homepage": "https://github.com/avifenesh/ferrings#readme",
|
|
99
|
+
"bugs": {
|
|
100
|
+
"url": "https://github.com/avifenesh/ferrings/issues"
|
|
101
|
+
},
|
|
91
102
|
"repository": {
|
|
92
103
|
"type": "git",
|
|
93
104
|
"url": "git+https://github.com/avifenesh/ferrings.git"
|