@tachyon-rs/server 0.2.10 → 0.2.13

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/index.js CHANGED
@@ -3,6 +3,9 @@
3
3
  // @ts-nocheck
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
+ const { createRequire } = require('node:module')
7
+ require = createRequire(__filename)
8
+
6
9
  const { readFileSync } = require('node:fs')
7
10
  let nativeBinding = null
8
11
  const loadErrors = []
@@ -77,8 +80,8 @@ function requireNative() {
77
80
  try {
78
81
  const binding = require('@tachyon-rs/server-android-arm64')
79
82
  const bindingPackageVersion = require('@tachyon-rs/server-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
83
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
84
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
85
  }
83
86
  return binding
84
87
  } catch (e) {
@@ -93,8 +96,8 @@ function requireNative() {
93
96
  try {
94
97
  const binding = require('@tachyon-rs/server-android-arm-eabi')
95
98
  const bindingPackageVersion = require('@tachyon-rs/server-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
99
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
100
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
101
  }
99
102
  return binding
100
103
  } catch (e) {
@@ -105,24 +108,7 @@ function requireNative() {
105
108
  }
106
109
  } else if (process.platform === 'win32') {
107
110
  if (process.arch === 'x64') {
108
- if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
109
- try {
110
- return require('./tachyon-napi.win32-x64-gnu.node')
111
- } catch (e) {
112
- loadErrors.push(e)
113
- }
114
111
  try {
115
- const binding = require('@tachyon-rs/server-win32-x64-gnu')
116
- const bindingPackageVersion = require('@tachyon-rs/server-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
- }
120
- return binding
121
- } catch (e) {
122
- loadErrors.push(e)
123
- }
124
- } else {
125
- try {
126
112
  return require('./tachyon-napi.win32-x64-msvc.node')
127
113
  } catch (e) {
128
114
  loadErrors.push(e)
@@ -130,14 +116,13 @@ function requireNative() {
130
116
  try {
131
117
  const binding = require('@tachyon-rs/server-win32-x64-msvc')
132
118
  const bindingPackageVersion = require('@tachyon-rs/server-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
120
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
121
  }
136
122
  return binding
137
123
  } catch (e) {
138
124
  loadErrors.push(e)
139
125
  }
140
- }
141
126
  } else if (process.arch === 'ia32') {
142
127
  try {
143
128
  return require('./tachyon-napi.win32-ia32-msvc.node')
@@ -147,8 +132,8 @@ function requireNative() {
147
132
  try {
148
133
  const binding = require('@tachyon-rs/server-win32-ia32-msvc')
149
134
  const bindingPackageVersion = require('@tachyon-rs/server-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
136
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
137
  }
153
138
  return binding
154
139
  } catch (e) {
@@ -163,8 +148,8 @@ function requireNative() {
163
148
  try {
164
149
  const binding = require('@tachyon-rs/server-win32-arm64-msvc')
165
150
  const bindingPackageVersion = require('@tachyon-rs/server-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
151
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
152
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
153
  }
169
154
  return binding
170
155
  } catch (e) {
@@ -182,8 +167,8 @@ function requireNative() {
182
167
  try {
183
168
  const binding = require('@tachyon-rs/server-darwin-universal')
184
169
  const bindingPackageVersion = require('@tachyon-rs/server-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
170
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
172
  }
188
173
  return binding
189
174
  } catch (e) {
@@ -198,8 +183,8 @@ function requireNative() {
198
183
  try {
199
184
  const binding = require('@tachyon-rs/server-darwin-x64')
200
185
  const bindingPackageVersion = require('@tachyon-rs/server-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
186
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
187
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
188
  }
204
189
  return binding
205
190
  } catch (e) {
@@ -214,8 +199,8 @@ function requireNative() {
214
199
  try {
215
200
  const binding = require('@tachyon-rs/server-darwin-arm64')
216
201
  const bindingPackageVersion = require('@tachyon-rs/server-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
202
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
203
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
204
  }
220
205
  return binding
221
206
  } catch (e) {
@@ -234,8 +219,8 @@ function requireNative() {
234
219
  try {
235
220
  const binding = require('@tachyon-rs/server-freebsd-x64')
236
221
  const bindingPackageVersion = require('@tachyon-rs/server-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
222
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
223
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
224
  }
240
225
  return binding
241
226
  } catch (e) {
@@ -250,8 +235,8 @@ function requireNative() {
250
235
  try {
251
236
  const binding = require('@tachyon-rs/server-freebsd-arm64')
252
237
  const bindingPackageVersion = require('@tachyon-rs/server-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
238
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
239
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
240
  }
256
241
  return binding
257
242
  } catch (e) {
@@ -271,8 +256,8 @@ function requireNative() {
271
256
  try {
272
257
  const binding = require('@tachyon-rs/server-linux-x64-musl')
273
258
  const bindingPackageVersion = require('@tachyon-rs/server-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
259
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
260
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
261
  }
277
262
  return binding
278
263
  } catch (e) {
@@ -287,8 +272,8 @@ function requireNative() {
287
272
  try {
288
273
  const binding = require('@tachyon-rs/server-linux-x64-gnu')
289
274
  const bindingPackageVersion = require('@tachyon-rs/server-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
275
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
276
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
277
  }
293
278
  return binding
294
279
  } catch (e) {
@@ -305,8 +290,8 @@ function requireNative() {
305
290
  try {
306
291
  const binding = require('@tachyon-rs/server-linux-arm64-musl')
307
292
  const bindingPackageVersion = require('@tachyon-rs/server-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
293
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
294
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
295
  }
311
296
  return binding
312
297
  } catch (e) {
@@ -321,8 +306,8 @@ function requireNative() {
321
306
  try {
322
307
  const binding = require('@tachyon-rs/server-linux-arm64-gnu')
323
308
  const bindingPackageVersion = require('@tachyon-rs/server-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
309
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
310
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
311
  }
327
312
  return binding
328
313
  } catch (e) {
@@ -339,8 +324,8 @@ function requireNative() {
339
324
  try {
340
325
  const binding = require('@tachyon-rs/server-linux-arm-musleabihf')
341
326
  const bindingPackageVersion = require('@tachyon-rs/server-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
327
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
328
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
329
  }
345
330
  return binding
346
331
  } catch (e) {
@@ -355,8 +340,8 @@ function requireNative() {
355
340
  try {
356
341
  const binding = require('@tachyon-rs/server-linux-arm-gnueabihf')
357
342
  const bindingPackageVersion = require('@tachyon-rs/server-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
343
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
344
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
345
  }
361
346
  return binding
362
347
  } catch (e) {
@@ -373,8 +358,8 @@ function requireNative() {
373
358
  try {
374
359
  const binding = require('@tachyon-rs/server-linux-loong64-musl')
375
360
  const bindingPackageVersion = require('@tachyon-rs/server-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
361
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
362
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
363
  }
379
364
  return binding
380
365
  } catch (e) {
@@ -389,8 +374,8 @@ function requireNative() {
389
374
  try {
390
375
  const binding = require('@tachyon-rs/server-linux-loong64-gnu')
391
376
  const bindingPackageVersion = require('@tachyon-rs/server-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
377
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
378
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
379
  }
395
380
  return binding
396
381
  } catch (e) {
@@ -407,8 +392,8 @@ function requireNative() {
407
392
  try {
408
393
  const binding = require('@tachyon-rs/server-linux-riscv64-musl')
409
394
  const bindingPackageVersion = require('@tachyon-rs/server-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
395
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
396
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
397
  }
413
398
  return binding
414
399
  } catch (e) {
@@ -423,8 +408,8 @@ function requireNative() {
423
408
  try {
424
409
  const binding = require('@tachyon-rs/server-linux-riscv64-gnu')
425
410
  const bindingPackageVersion = require('@tachyon-rs/server-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
411
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
412
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
413
  }
429
414
  return binding
430
415
  } catch (e) {
@@ -440,8 +425,8 @@ function requireNative() {
440
425
  try {
441
426
  const binding = require('@tachyon-rs/server-linux-ppc64-gnu')
442
427
  const bindingPackageVersion = require('@tachyon-rs/server-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
429
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
430
  }
446
431
  return binding
447
432
  } catch (e) {
@@ -456,8 +441,8 @@ function requireNative() {
456
441
  try {
457
442
  const binding = require('@tachyon-rs/server-linux-s390x-gnu')
458
443
  const bindingPackageVersion = require('@tachyon-rs/server-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
444
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
445
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
446
  }
462
447
  return binding
463
448
  } catch (e) {
@@ -476,8 +461,8 @@ function requireNative() {
476
461
  try {
477
462
  const binding = require('@tachyon-rs/server-openharmony-arm64')
478
463
  const bindingPackageVersion = require('@tachyon-rs/server-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
464
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
465
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
466
  }
482
467
  return binding
483
468
  } catch (e) {
@@ -492,8 +477,8 @@ function requireNative() {
492
477
  try {
493
478
  const binding = require('@tachyon-rs/server-openharmony-x64')
494
479
  const bindingPackageVersion = require('@tachyon-rs/server-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
480
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
481
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
482
  }
498
483
  return binding
499
484
  } catch (e) {
@@ -508,8 +493,8 @@ function requireNative() {
508
493
  try {
509
494
  const binding = require('@tachyon-rs/server-openharmony-arm')
510
495
  const bindingPackageVersion = require('@tachyon-rs/server-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '0.2.0' && 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.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
496
+ if (bindingPackageVersion !== '0.2.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
497
+ throw new Error(`Native binding package version mismatch, expected 0.2.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
498
  }
514
499
  return binding
515
500
  } catch (e) {
@@ -536,17 +521,13 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
536
521
  wasiBindingError = err
537
522
  }
538
523
  }
539
- if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
524
+ if (!nativeBinding) {
540
525
  try {
541
526
  wasiBinding = require('@tachyon-rs/server-wasm32-wasi')
542
527
  nativeBinding = wasiBinding
543
528
  } catch (err) {
544
529
  if (process.env.NAPI_RS_FORCE_WASI) {
545
- if (!wasiBindingError) {
546
- wasiBindingError = err
547
- } else {
548
- wasiBindingError.cause = err
549
- }
530
+ wasiBindingError.cause = err
550
531
  loadErrors.push(err)
551
532
  }
552
533
  }
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.13",
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.13",
108
+ "@tachyon-rs/server-darwin-x64": "0.2.13",
109
+ "@tachyon-rs/server-linux-x64-gnu": "0.2.13",
110
+ "@tachyon-rs/server-darwin-arm64": "0.2.13"
111
111
  }
112
112
  }