@tachyon-rs/server 0.2.10 → 0.2.11

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,27 +1,29 @@
1
1
  # @tachyon-rs/server
2
2
 
3
- Bindings NAPI nativos do tachyon-rs para Node.js e Bun. Este pacote e a ponte entre o servidor HTTP em Rust e o runtime JavaScript.
3
+ Native NAPI bindings from tachyon-rs for Node.js and Bun. This package is the bridge between the Rust HTTP server and the JavaScript runtime.
4
4
 
5
- > **Nota:** Este pacote e usado internamente pelo [`tachyon-rs`](https://www.npmjs.com/package/tachyon-rs). Para a maioria dos casos, use `tachyon-rs` diretamente.
5
+ **[Leia em Portugues](README.pt-BR.md)**
6
6
 
7
- ## Instalacao
7
+ > **Note:** This package is used internally by [`tachyon-rs`](https://www.npmjs.com/package/tachyon-rs). For most use cases, use `tachyon-rs` directly.
8
+
9
+ ## Installation
8
10
 
9
11
  ```bash
10
12
  npm install @tachyon-rs/server
11
13
  ```
12
14
 
13
- O binario nativo correto para sua plataforma e instalado automaticamente via `optionalDependencies`.
15
+ The correct native binary for your platform is installed automatically via `optionalDependencies`.
14
16
 
15
- ### Plataformas suportadas
17
+ ### Supported platforms
16
18
 
17
- | Plataforma | Arquitetura | Pacote |
19
+ | Platform | Architecture | Package |
18
20
  |---|---|---|
19
21
  | Linux | x64 | `@tachyon-rs/server-linux-x64-gnu` |
20
22
  | macOS | x64 | `@tachyon-rs/server-darwin-x64` |
21
23
  | macOS | ARM64 | `@tachyon-rs/server-darwin-arm64` |
22
24
  | Windows | x64 | `@tachyon-rs/server-win32-x64-msvc` |
23
25
 
24
- ## Uso direto (baixo nivel)
26
+ ## Direct usage (low-level)
25
27
 
26
28
  ```typescript
27
29
  import { TachyonRawServer } from '@tachyon-rs/server'
@@ -42,16 +44,16 @@ server.start((request) => {
42
44
  })
43
45
  ```
44
46
 
45
- ## Configuracao
47
+ ## Configuration
46
48
 
47
- | Opcao | Tipo | Default | Descricao |
49
+ | Option | Type | Default | Description |
48
50
  |---|---|---|---|
49
- | `bindAddr` | `string` | `"0.0.0.0:3000"` | Endereco e porta |
50
- | `workers` | `number` | CPU count | Threads de worker |
51
- | `stackSizeKb` | `number` | `64` | Stack size das coroutines (KB) |
52
- | `buffersPerWorker` | `number` | `128` | Buffers no pool por worker |
53
- | `bufferSize` | `number` | `8192` | Tamanho de cada buffer (bytes) |
54
- | `timeoutSecs` | `number` | `30` | Timeout do handler (segundos) |
51
+ | `bindAddr` | `string` | `"0.0.0.0:3000"` | Address and port |
52
+ | `workers` | `number` | CPU count | Worker threads |
53
+ | `stackSizeKb` | `number` | `64` | Coroutine stack size (KB) |
54
+ | `buffersPerWorker` | `number` | `128` | Buffers in pool per worker |
55
+ | `bufferSize` | `number` | `8192` | Size of each buffer (bytes) |
56
+ | `timeoutSecs` | `number` | `30` | Handler timeout (seconds) |
55
57
  | `tcpNodelay` | `boolean` | `true` | TCP_NODELAY |
56
58
  | `reusePort` | `boolean` | `true` | SO_REUSEPORT (Linux/BSD) |
57
59
  | `tcpFastopen` | `boolean` | `true` | TCP Fast Open (Linux) |
@@ -59,9 +61,9 @@ server.start((request) => {
59
61
  | `recvBufSize` | `number` | `0` | SO_RCVBUF (0 = OS default) |
60
62
  | `sendBufSize` | `number` | `0` | SO_SNDBUF (0 = OS default) |
61
63
  | `security` | `string` | `"basic"` | `"none"` \| `"basic"` \| `"strict"` |
62
- | `compressionThreshold` | `number` | `1024` | 0 = comprime tudo, -1 = desabilitado |
64
+ | `compressionThreshold` | `number` | `1024` | 0 = compress all, -1 = disabled |
63
65
 
64
- ## Build local
66
+ ## Local build
65
67
 
66
68
  ```bash
67
69
  bun install
@@ -69,6 +71,6 @@ bun run build # release
69
71
  bun run build:debug # debug
70
72
  ```
71
73
 
72
- ## Licenca
74
+ ## License
73
75
 
74
76
  MIT
@@ -0,0 +1,76 @@
1
+ # @tachyon-rs/server
2
+
3
+ Bindings NAPI nativos do tachyon-rs para Node.js e Bun. Este pacote e a ponte entre o servidor HTTP em Rust e o runtime JavaScript.
4
+
5
+ **[Read in English](README.md)**
6
+
7
+ > **Nota:** Este pacote e usado internamente pelo [`tachyon-rs`](https://www.npmjs.com/package/tachyon-rs). Para a maioria dos casos, use `tachyon-rs` diretamente.
8
+
9
+ ## Instalacao
10
+
11
+ ```bash
12
+ npm install @tachyon-rs/server
13
+ ```
14
+
15
+ O binario nativo correto para sua plataforma e instalado automaticamente via `optionalDependencies`.
16
+
17
+ ### Plataformas suportadas
18
+
19
+ | Plataforma | Arquitetura | Pacote |
20
+ |---|---|---|
21
+ | Linux | x64 | `@tachyon-rs/server-linux-x64-gnu` |
22
+ | macOS | x64 | `@tachyon-rs/server-darwin-x64` |
23
+ | macOS | ARM64 | `@tachyon-rs/server-darwin-arm64` |
24
+ | Windows | x64 | `@tachyon-rs/server-win32-x64-msvc` |
25
+
26
+ ## Uso direto (baixo nivel)
27
+
28
+ ```typescript
29
+ import { TachyonRawServer } from '@tachyon-rs/server'
30
+
31
+ const server = new TachyonRawServer({
32
+ bindAddr: '0.0.0.0:3000',
33
+ workers: 4,
34
+ security: 'basic',
35
+ compressionThreshold: 1024,
36
+ })
37
+
38
+ server.start((request) => {
39
+ return {
40
+ status: 200,
41
+ body: JSON.stringify({ hello: 'world' }),
42
+ headers: [{ name: 'Content-Type', value: 'application/json' }],
43
+ }
44
+ })
45
+ ```
46
+
47
+ ## Configuracao
48
+
49
+ | Opcao | Tipo | Default | Descricao |
50
+ |---|---|---|---|
51
+ | `bindAddr` | `string` | `"0.0.0.0:3000"` | Endereco e porta |
52
+ | `workers` | `number` | CPU count | Threads de worker |
53
+ | `stackSizeKb` | `number` | `64` | Stack size das coroutines (KB) |
54
+ | `buffersPerWorker` | `number` | `128` | Buffers no pool por worker |
55
+ | `bufferSize` | `number` | `8192` | Tamanho de cada buffer (bytes) |
56
+ | `timeoutSecs` | `number` | `30` | Timeout do handler (segundos) |
57
+ | `tcpNodelay` | `boolean` | `true` | TCP_NODELAY |
58
+ | `reusePort` | `boolean` | `true` | SO_REUSEPORT (Linux/BSD) |
59
+ | `tcpFastopen` | `boolean` | `true` | TCP Fast Open (Linux) |
60
+ | `busyPollUs` | `number` | `0` | SO_BUSY_POLL microseconds |
61
+ | `recvBufSize` | `number` | `0` | SO_RCVBUF (0 = OS default) |
62
+ | `sendBufSize` | `number` | `0` | SO_SNDBUF (0 = OS default) |
63
+ | `security` | `string` | `"basic"` | `"none"` \| `"basic"` \| `"strict"` |
64
+ | `compressionThreshold` | `number` | `1024` | 0 = comprime tudo, -1 = desabilitado |
65
+
66
+ ## Build local
67
+
68
+ ```bash
69
+ bun install
70
+ bun run build # release
71
+ bun run build:debug # debug
72
+ ```
73
+
74
+ ## Licenca
75
+
76
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachyon-rs/server",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Template project for writing node package with napi-rs",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -104,9 +104,9 @@
104
104
  },
105
105
  "packageManager": "bun@1.2.5",
106
106
  "optionalDependencies": {
107
- "@tachyon-rs/server-win32-x64-msvc": "0.2.10",
108
- "@tachyon-rs/server-darwin-x64": "0.2.10",
109
- "@tachyon-rs/server-linux-x64-gnu": "0.2.10",
110
- "@tachyon-rs/server-darwin-arm64": "0.2.10"
107
+ "@tachyon-rs/server-win32-x64-msvc": "0.2.11",
108
+ "@tachyon-rs/server-darwin-x64": "0.2.11",
109
+ "@tachyon-rs/server-linux-x64-gnu": "0.2.11",
110
+ "@tachyon-rs/server-darwin-arm64": "0.2.11"
111
111
  }
112
112
  }