@local-sandbox/lsb-nodejs 0.1.1 → 0.3.0

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.
Files changed (4) hide show
  1. package/README.md +86 -32
  2. package/index.d.ts +290 -12
  3. package/index.js +53 -50
  4. package/package.json +3 -3
package/README.md CHANGED
@@ -27,11 +27,9 @@ corepack yarn install
27
27
 
28
28
  - Node.js 18+
29
29
  - macOS 14+ on Apple Silicon or Intel x86_64
30
- - [lsb CLI](https://github.com/LocalSandBox/local-sandbox.git) installed
31
- - `Sandbox.start()` expects the lsb runtime data directory to already exist. In the default
32
- location, `~/.local/share/lsb/Image` must be present before booting a sandbox. This VM image
33
- is not bundled with `@local-sandbox/lsb-nodejs` and needs to be downloaded manually as part of your
34
- lsb runtime setup.
30
+ - Runtime assets initialized with `initSandbox()` or `lsb init`. `Sandbox.start()` still expects
31
+ the lsb runtime data directory to already contain `Image`, `rootfs.ext4`, and
32
+ `initramfs.cpio.gz`; it does not download assets implicitly.
35
33
  - On macOS, the `node` executable loading this SDK must be code signed with the
36
34
  `com.apple.security.virtualization` entitlement. For a project-local workflow, sign a copied
37
35
  Node binary with [`../../lsb.entitlements`](../../lsb.entitlements), or use
@@ -42,17 +40,17 @@ corepack yarn install
42
40
  ### Start a sandbox and run commands
43
41
 
44
42
  ```ts
45
- import { Sandbox } from '@local-sandbox/lsb-nodejs'
43
+ import { Sandbox, initSandbox } from '@local-sandbox/lsb-nodejs'
46
44
 
47
45
  const dataDir = `${process.env.HOME}/.local/share/lsb`
46
+ await initSandbox({ dataDir })
47
+
48
48
  const sandbox = await Sandbox.start({
49
49
  dataDir,
50
50
  cpus: 2,
51
- memory: 2048,
52
- allowNet: true,
53
- mounts: {
54
- './src': '/workspace',
55
- },
51
+ memoryMb: 2048,
52
+ mounts: [{ type: 'overlay', hostPath: './src', guestPath: '/workspace' }],
53
+ network: { allow: ['registry.npmjs.org'] },
56
54
  })
57
55
 
58
56
  const result = await sandbox.exec('echo hello from lsb')
@@ -65,6 +63,15 @@ console.log(content.toString())
65
63
  await sandbox.stop()
66
64
  ```
67
65
 
66
+ ### Initialize runtime assets
67
+
68
+ ```ts
69
+ import { initSandbox } from '@local-sandbox/lsb-nodejs'
70
+
71
+ const init = await initSandbox()
72
+ console.log(init.dataDir, init.version, init.downloaded)
73
+ ```
74
+
68
75
  ### Pass argv directly or run through a shell
69
76
 
70
77
  ```ts
@@ -123,15 +130,17 @@ import { Sandbox } from '@local-sandbox/lsb-nodejs'
123
130
 
124
131
  const sandbox = await Sandbox.start({
125
132
  cpus: 4,
126
- memory: 4096,
127
- diskSize: 8192,
128
- allowNet: true,
129
- ports: ['8080:80'],
130
- mounts: { './src': '/workspace' },
131
- secrets: {
132
- API_KEY: { value: 'sk-test', hosts: ['api.openai.com'] },
133
+ memoryMb: 4096,
134
+ diskSizeMb: 8192,
135
+ ports: [{ host: 8080, guest: 80 }],
136
+ mounts: [{ type: 'direct', hostPath: './src', guestPath: '/workspace', flags: 0 }],
137
+ network: {
138
+ allow: ['api.openai.com', 'registry.npmjs.org'],
139
+ exposeHost: [{ host: 3000, guest: 3000 }],
140
+ secrets: {
141
+ API_KEY: { value: 'sk-test', hosts: ['api.openai.com'] },
142
+ },
133
143
  },
134
- network: { allow: ['api.openai.com', 'registry.npmjs.org'] },
135
144
  })
136
145
 
137
146
  console.log(sandbox.instanceDir)
@@ -141,19 +150,64 @@ await sandbox.stop()
141
150
 
142
151
  ### Start options
143
152
 
144
- | Option | Type | Description |
145
- |--------|------|-------------|
146
- | `from` | `string` | Checkpoint name to start from |
147
- | `cpus` | `number` | Number of vCPUs |
148
- | `memory` | `number` | Memory in MB |
149
- | `diskSize` | `number` | Disk size in MB |
150
- | `dataDir` | `string` | lsb runtime data directory |
151
- | `allowNet` | `boolean` | Enable network access |
152
- | `allowedHosts` | `string[]` | Additional allowlisted hosts |
153
- | `ports` | `string[]` | Port forwards (`"host:guest"`) |
154
- | `mounts` | `Record<string, string>` | Directory mounts (`{ hostPath: guestPath }`) |
155
- | `secrets` | `Record<string, SecretConfig>` | Secrets injected via the lsb proxy |
156
- | `network` | `NetworkConfig` | Network access policy |
153
+ | Option | Type | Description |
154
+ | ------------ | ----------------------------------- | ------------------------------ |
155
+ | `instanceId` | `string` | Stable instance directory name |
156
+ | `from` | `string` | Checkpoint name to start from |
157
+ | `cpus` | `number` | Number of vCPUs |
158
+ | `memoryMb` | `number` | Memory in MB |
159
+ | `diskSizeMb` | `number` | Disk size in MB |
160
+ | `dataDir` | `string` | lsb runtime data directory |
161
+ | `ports` | `{ host: number; guest: number }[]` | Host-to-guest port forwards |
162
+ | `mounts` | `MountConfig[]` | Directory mounts |
163
+ | `network` | `NetworkConfig` | Network access policy |
164
+
165
+ `mounts` accepts discriminated entries:
166
+
167
+ | Type | Shape | Behavior |
168
+ | --------- | ------------------------------------------------------------------------ | --------------------------------------------- |
169
+ | `overlay` | `{ type: 'overlay'; hostPath: string; guestPath: string }` | Host is read-only; guest writes go to overlay |
170
+ | `direct` | `{ type: 'direct'; hostPath: string; guestPath: string; flags: number }` | Mounts VirtioFS directly with libc flags |
171
+
172
+ For direct mounts, `flags: 0` is read-write and `flags: 1` is `MS_RDONLY`.
173
+
174
+ `network` enables proxy networking when present. It accepts:
175
+
176
+ | Option | Type | Description |
177
+ | ------------ | ------------------------------------ | ---------------------------------- |
178
+ | `allow` | `string[]` | Allowed outbound host patterns |
179
+ | `exposeHost` | `{ host: number; guest?: number }[]` | Host ports exposed to the guest |
180
+ | `secrets` | `Record<string, SecretConfig>` | Secrets injected via the lsb proxy |
181
+
182
+ ### Stream process output
183
+
184
+ ```ts
185
+ import { Sandbox } from '@local-sandbox/lsb-nodejs'
186
+
187
+ const sandbox = await Sandbox.start()
188
+ const proc = await sandbox.spawn('echo out; echo err >&2')
189
+
190
+ for await (const chunk of proc.stdout) {
191
+ process.stdout.write(chunk)
192
+ }
193
+
194
+ console.log(await proc.exited)
195
+
196
+ await sandbox.stop()
197
+ ```
198
+
199
+ ### Watch files
200
+
201
+ ```ts
202
+ import { Sandbox } from '@local-sandbox/lsb-nodejs'
203
+
204
+ const sandbox = await Sandbox.start()
205
+ const events = await sandbox.watch('/tmp')
206
+
207
+ for await (const event of events) {
208
+ console.log(event.path, event.event)
209
+ }
210
+ ```
157
211
 
158
212
  ## Scripts
159
213
 
package/index.d.ts CHANGED
@@ -1,106 +1,384 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
+ /**
4
+ * Async byte stream returned by process stdout and stderr.
5
+ *
6
+ * Usage: `for await (const chunk of proc.stdout) process.stdout.write(chunk)`
7
+ *
8
+ * This type implements JavaScript's async iterable protocol.
9
+ * It can be used with `for await...of` loops.
10
+ *
11
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols
12
+ */
13
+ export declare class ByteStream {
14
+
15
+ }
16
+
17
+ /**
18
+ * Running sandbox VM instance.
19
+ *
20
+ * Usage: `const sandbox = await Sandbox.start(); await sandbox.stop()`
21
+ */
3
22
  export declare class Sandbox {
23
+ /**
24
+ * Boot a new sandbox VM.
25
+ *
26
+ * Usage: `const sandbox = await Sandbox.start({ cpus: 2, mounts: [{ type: 'overlay', hostPath: '.', guestPath: '/workspace' }] })`
27
+ */
4
28
  static start(opts?: StartOptions | undefined | null): Promise<Sandbox>
29
+ /**
30
+ * Execute a command and wait for stdout, stderr, and exit code.
31
+ *
32
+ * Usage: `const result = await sandbox.exec('npm test', { cwd: '/workspace' })`
33
+ */
5
34
  exec(command: string | Array<string>, opts?: ExecOptions | undefined | null): Promise<ExecResult>
6
- execShell(command: string): Promise<ExecResult>
35
+ /**
36
+ * Execute a shell command string with the SDK shell runner.
37
+ *
38
+ * Usage: `const result = await sandbox.execShell('echo $PWD && ls', { cwd: '/workspace' })`
39
+ */
40
+ execShell(command: string, opts?: ExecOptions | undefined | null): Promise<ExecResult>
41
+ /**
42
+ * Start a long-running process with streamable stdout and stderr.
43
+ *
44
+ * Usage: `const proc = await sandbox.spawn(['node', 'server.js'], { cwd: '/workspace' })`
45
+ */
7
46
  spawn(command: string | Array<string>, opts?: SpawnOptions | undefined | null): Promise<SpawnedProcess>
8
- watch(path: string, callback: (arg: FileChangeEvent) => unknown, opts?: WatchOptions | undefined | null): void
47
+ /**
48
+ * Watch a guest path for file changes.
49
+ *
50
+ * Usage: `for await (const event of await sandbox.watch('/workspace')) console.log(event.path, event.event)`
51
+ */
52
+ watch(path: string, opts?: WatchOptions | undefined | null): Promise<WatchStream>
53
+ /**
54
+ * Read a guest file as a Buffer.
55
+ *
56
+ * Usage: `const content = await sandbox.readFile('/workspace/package.json')`
57
+ */
9
58
  readFile(path: string): Promise<Buffer>
59
+ /**
60
+ * Write a string or Uint8Array to a guest file.
61
+ *
62
+ * Usage: `await sandbox.writeFile('/tmp/input.txt', 'hello')`
63
+ */
10
64
  writeFile(path: string, content: string | Uint8Array): Promise<void>
65
+ /**
66
+ * Create a guest directory.
67
+ *
68
+ * Usage: `await sandbox.mkdir('/workspace/out', { recursive: true })`
69
+ */
11
70
  mkdir(path: string, opts?: MkdirOptions | undefined | null): Promise<void>
71
+ /**
72
+ * List entries in a guest directory.
73
+ *
74
+ * Usage: `const entries = await sandbox.readDir('/workspace')`
75
+ */
12
76
  readDir(path: string): Promise<Array<DirEntry>>
77
+ /**
78
+ * Return metadata for a guest path.
79
+ *
80
+ * Usage: `const stat = await sandbox.stat('/workspace/package.json')`
81
+ */
13
82
  stat(path: string): Promise<StatResult>
83
+ /**
84
+ * Remove a guest file or directory.
85
+ *
86
+ * Usage: `await sandbox.remove('/workspace/out', { recursive: true })`
87
+ */
14
88
  remove(path: string, opts?: RemoveOptions | undefined | null): Promise<void>
89
+ /**
90
+ * Rename or move a guest file or directory.
91
+ *
92
+ * Usage: `await sandbox.rename('/tmp/a.txt', '/tmp/b.txt')`
93
+ */
15
94
  rename(oldPath: string, newPath: string): Promise<void>
95
+ /**
96
+ * Copy a guest file or directory.
97
+ *
98
+ * Usage: `await sandbox.copy('/workspace/src', '/workspace/src-copy', { recursive: true })`
99
+ */
16
100
  copy(src: string, dst: string, opts?: CopyOptions | undefined | null): Promise<void>
101
+ /**
102
+ * Change permission bits on a guest path.
103
+ *
104
+ * Usage: `await sandbox.chmod('/workspace/script.sh', 0o755)`
105
+ */
17
106
  chmod(path: string, mode: number): Promise<void>
107
+ /**
108
+ * Check whether a guest path exists.
109
+ *
110
+ * Usage: `if (await sandbox.exists('/workspace/package.json')) console.log('found')`
111
+ */
18
112
  exists(path: string): Promise<boolean>
113
+ /**
114
+ * Save a named VM checkpoint that can be used with `Sandbox.start({ from })`.
115
+ *
116
+ * Usage: `await sandbox.checkpoint('deps-installed')`
117
+ */
19
118
  checkpoint(name: string): Promise<void>
119
+ /**
120
+ * Stop the sandbox VM and release runtime resources.
121
+ *
122
+ * Usage: `await sandbox.stop()`
123
+ */
20
124
  stop(): Promise<void>
125
+ /**
126
+ * Absolute host path for this sandbox instance directory.
127
+ *
128
+ * Usage: `console.log(sandbox.instanceDir)`
129
+ */
21
130
  get instanceDir(): string
22
131
  }
23
132
 
133
+ /**
134
+ * Handle for a process spawned inside the sandbox.
135
+ *
136
+ * Usage: `const proc = await sandbox.spawn('npm test')`
137
+ */
24
138
  export declare class SpawnedProcess {
25
- on(event: string, callback: (arg: unknown) => unknown): void
139
+ /**
140
+ * Stream stdout chunks from the spawned process.
141
+ *
142
+ * Usage: `for await (const chunk of proc.stdout) process.stdout.write(chunk)`
143
+ */
144
+ get stdout(): ByteStream
145
+ /**
146
+ * Stream stderr chunks from the spawned process.
147
+ *
148
+ * Usage: `for await (const chunk of proc.stderr) process.stderr.write(chunk)`
149
+ */
150
+ get stderr(): ByteStream
151
+ /**
152
+ * Write data to the process stdin.
153
+ *
154
+ * Usage: `proc.write('hello')`
155
+ */
26
156
  write(data: string | Uint8Array): void
27
- kill(): Promise<void>
28
- get pid(): string
157
+ /**
158
+ * Request termination of the process.
159
+ *
160
+ * Usage: `proc.kill()`
161
+ */
162
+ kill(): void
163
+ /**
164
+ * Promise resolving to the process exit code.
165
+ *
166
+ * Usage: `const exitCode = await proc.exited`
167
+ */
29
168
  get exited(): Promise<number>
30
169
  }
31
170
 
171
+ /**
172
+ * Async stream of file change events returned by `sandbox.watch`.
173
+ *
174
+ * Usage: `for await (const event of await sandbox.watch('/workspace')) console.log(event.path)`
175
+ *
176
+ * This type implements JavaScript's async iterable protocol.
177
+ * It can be used with `for await...of` loops.
178
+ *
179
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols
180
+ */
181
+ export declare class WatchStream {
182
+
183
+ }
184
+
185
+ /** Options for copying files or directories. */
32
186
  export interface CopyOptions {
187
+ /** Copy directory trees recursively. Defaults to false. */
33
188
  recursive?: boolean
34
189
  }
35
190
 
191
+ /** Directory entry returned by `readDir`. */
36
192
  export interface DirEntry {
193
+ /** Entry basename. */
37
194
  name: string
195
+ /** Entry type such as `file`, `dir`, or `symlink`. */
38
196
  type: string
197
+ /** Entry size in bytes. */
39
198
  size: number
40
199
  }
41
200
 
201
+ /** Per-command execution options. */
42
202
  export interface ExecOptions {
203
+ /** Guest working directory. */
204
+ cwd?: string
205
+ /** Additional environment variables. */
206
+ env?: Record<string, string>
207
+ /** Shell used when the command is a string. Defaults to `sh`. */
43
208
  shell?: string
44
209
  }
45
210
 
211
+ /** Completed command result. */
46
212
  export interface ExecResult {
213
+ /** Captured stdout as UTF-8 text. */
47
214
  stdout: string
215
+ /** Captured stderr as UTF-8 text. */
48
216
  stderr: string
217
+ /** Process exit code. */
49
218
  exitCode: number
50
219
  }
51
220
 
221
+ /** Host port made reachable from inside the guest via host.lsb.internal. */
222
+ export interface ExposeHostConfig {
223
+ /** Port on the host machine. */
224
+ host: number
225
+ /** Port visible to the guest. Defaults to `host` when omitted. */
226
+ guest?: number
227
+ }
228
+
229
+ /** File watcher event. */
52
230
  export interface FileChangeEvent {
231
+ /** Changed guest path. */
53
232
  path: string
233
+ /** Event kind reported by the guest watcher. */
54
234
  event: string
55
235
  }
56
236
 
237
+ /**
238
+ * Download or verify sandbox runtime assets such as kernel, rootfs, and initramfs.
239
+ *
240
+ * Usage: `await initSandbox({ dataDir, force: false })`
241
+ */
242
+ export declare function initSandbox(opts?: SandboxInitOptions | undefined | null): Promise<SandboxInitResult>
243
+
244
+ /** Options for directory creation. */
57
245
  export interface MkdirOptions {
246
+ /** Create parent directories as needed. Defaults to true. */
58
247
  recursive?: boolean
59
248
  }
60
249
 
250
+ /** Directory mount configuration. */
251
+ export interface MountConfig {
252
+ /** Mount behavior: `overlay` isolates writes, `direct` applies libc mount flags. */
253
+ type: 'overlay' | 'direct'
254
+ /** Existing host directory to share with the VM. */
255
+ hostPath: string
256
+ /** Absolute guest path where the directory appears. */
257
+ guestPath: string
258
+ /** libc mount flags for direct mounts. Use `0` for read-write, `1` for MS_RDONLY. */
259
+ flags?: number
260
+ }
261
+
262
+ /** Network policy for a sandbox. */
61
263
  export interface NetworkConfig {
264
+ /** Outbound host patterns allowed by the proxy. */
62
265
  allow?: Array<string>
266
+ /** Host ports exposed to the guest. */
267
+ exposeHost?: Array<ExposeHostConfig>
268
+ /** Secrets injected by the proxy for allowed hosts. */
269
+ secrets?: Record<string, SecretConfig>
270
+ }
271
+
272
+ /** Host-to-guest TCP port forwarding rule. */
273
+ export interface PortMappingConfig {
274
+ /** Host port to listen on. */
275
+ host: number
276
+ /** Guest port to forward to. */
277
+ guest: number
63
278
  }
64
279
 
280
+ /** Options for removing files or directories. */
65
281
  export interface RemoveOptions {
282
+ /** Remove directory trees recursively. Defaults to false. */
66
283
  recursive?: boolean
67
284
  }
68
285
 
286
+ /** Runtime asset paths derived from a sandbox data directory. */
287
+ export interface SandboxAssetPaths {
288
+ /** Runtime data directory. */
289
+ dataDir: string
290
+ /** VERSION marker path. */
291
+ versionFile: string
292
+ /** Linux kernel image path. */
293
+ kernel: string
294
+ /** Writable root filesystem base image path. */
295
+ rootfs: string
296
+ /** Initramfs image path. */
297
+ initramfs: string
298
+ /** Checkpoint storage directory. */
299
+ checkpointsDir: string
300
+ /** Per-sandbox instance directory root. */
301
+ instancesDir: string
302
+ }
303
+
304
+ /** Options used when initializing sandbox runtime assets. */
305
+ export interface SandboxInitOptions {
306
+ /** Runtime data directory. Defaults to `~/.local/share/lsb`. */
307
+ dataDir?: string
308
+ /** Re-download assets even when the expected files and VERSION marker already exist. */
309
+ force?: boolean
310
+ }
311
+
312
+ /** Result returned after initializing or checking sandbox runtime assets. */
313
+ export interface SandboxInitResult {
314
+ /** Runtime data directory that was checked or initialized. */
315
+ dataDir: string
316
+ /** Runtime asset version now expected in the data directory. */
317
+ version: string
318
+ /** True when this call downloaded and extracted assets. */
319
+ downloaded: boolean
320
+ /** Concrete runtime asset paths. */
321
+ paths: SandboxAssetPaths
322
+ }
323
+
324
+ /** Secret value that is only exposed to requests for the listed hosts. */
69
325
  export interface SecretConfig {
326
+ /** Secret payload or source value. */
70
327
  value: string
328
+ /** Host allowlist for this secret. */
71
329
  hosts: Array<string>
72
330
  }
73
331
 
332
+ /** Options for spawned processes. */
74
333
  export interface SpawnOptions {
334
+ /** Guest working directory. */
75
335
  cwd?: string
336
+ /** Additional environment variables. */
76
337
  env?: Record<string, string>
338
+ /** Shell used when the command is a string. Defaults to `sh`. */
77
339
  shell?: string
78
340
  }
79
341
 
342
+ /** Options used when booting a sandbox. */
80
343
  export interface StartOptions {
344
+ /** Stable instance directory name. */
81
345
  instanceId?: string
346
+ /** Checkpoint name to resume from. */
82
347
  from?: string
348
+ /** Number of virtual CPUs. */
83
349
  cpus?: number
84
- memory?: number
85
- diskSize?: number
350
+ /** Guest memory in MiB. */
351
+ memoryMb?: number
352
+ /** Writable root disk size in MiB. */
353
+ diskSizeMb?: number
354
+ /** Runtime data directory containing VM assets and instances. */
86
355
  dataDir?: string
87
- allowNet?: boolean
88
- allowedHosts?: Array<string>
89
- ports?: Array<string>
90
- mounts?: Record<string, string>
91
- secrets?: Record<string, SecretConfig>
356
+ /** Host-to-guest port forwards. */
357
+ ports?: Array<PortMappingConfig>
358
+ /** Directory mounts applied during boot. */
359
+ mounts?: Array<{ type: 'overlay'; hostPath: string; guestPath: string } | { type: 'direct'; hostPath: string; guestPath: string; flags: number }>
360
+ /** Network proxy, host exposure, and secret policy. */
92
361
  network?: NetworkConfig
93
362
  }
94
363
 
364
+ /** File metadata returned by `stat`. */
95
365
  export interface StatResult {
366
+ /** Size in bytes. */
96
367
  size: number
368
+ /** POSIX mode bits. */
97
369
  mode: number
370
+ /** Modified time as a Unix timestamp in milliseconds. */
98
371
  mtime: number
372
+ /** True when the path is a directory. */
99
373
  isDir: boolean
374
+ /** True when the path is a regular file. */
100
375
  isFile: boolean
376
+ /** True when the path is a symbolic link. */
101
377
  isSymlink: boolean
102
378
  }
103
379
 
380
+ /** Options for file watching. */
104
381
  export interface WatchOptions {
382
+ /** Watch subdirectories recursively. Defaults to true. */
105
383
  recursive?: boolean
106
384
  }
package/index.js CHANGED
@@ -80,8 +80,8 @@ function requireNative() {
80
80
  try {
81
81
  const binding = require('@local-sandbox/lsb-nodejs-android-arm64')
82
82
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-android-arm64/package.json').version
83
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
83
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
85
85
  }
86
86
  return binding
87
87
  } catch (e) {
@@ -96,8 +96,8 @@ function requireNative() {
96
96
  try {
97
97
  const binding = require('@local-sandbox/lsb-nodejs-android-arm-eabi')
98
98
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-android-arm-eabi/package.json').version
99
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
99
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
101
101
  }
102
102
  return binding
103
103
  } catch (e) {
@@ -116,8 +116,8 @@ function requireNative() {
116
116
  try {
117
117
  const binding = require('@local-sandbox/lsb-nodejs-win32-x64-msvc')
118
118
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-win32-x64-msvc/package.json').version
119
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
121
121
  }
122
122
  return binding
123
123
  } catch (e) {
@@ -132,8 +132,8 @@ function requireNative() {
132
132
  try {
133
133
  const binding = require('@local-sandbox/lsb-nodejs-win32-ia32-msvc')
134
134
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-win32-ia32-msvc/package.json').version
135
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
137
137
  }
138
138
  return binding
139
139
  } catch (e) {
@@ -148,8 +148,8 @@ function requireNative() {
148
148
  try {
149
149
  const binding = require('@local-sandbox/lsb-nodejs-win32-arm64-msvc')
150
150
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-win32-arm64-msvc/package.json').version
151
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
151
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
153
153
  }
154
154
  return binding
155
155
  } catch (e) {
@@ -167,8 +167,8 @@ function requireNative() {
167
167
  try {
168
168
  const binding = require('@local-sandbox/lsb-nodejs-darwin-universal')
169
169
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-darwin-universal/package.json').version
170
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
170
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
172
172
  }
173
173
  return binding
174
174
  } catch (e) {
@@ -183,8 +183,8 @@ function requireNative() {
183
183
  try {
184
184
  const binding = require('@local-sandbox/lsb-nodejs-darwin-x64')
185
185
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-darwin-x64/package.json').version
186
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
186
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
188
188
  }
189
189
  return binding
190
190
  } catch (e) {
@@ -199,8 +199,8 @@ function requireNative() {
199
199
  try {
200
200
  const binding = require('@local-sandbox/lsb-nodejs-darwin-arm64')
201
201
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-darwin-arm64/package.json').version
202
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
202
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
204
204
  }
205
205
  return binding
206
206
  } catch (e) {
@@ -219,8 +219,8 @@ function requireNative() {
219
219
  try {
220
220
  const binding = require('@local-sandbox/lsb-nodejs-freebsd-x64')
221
221
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-freebsd-x64/package.json').version
222
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
222
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
224
224
  }
225
225
  return binding
226
226
  } catch (e) {
@@ -235,8 +235,8 @@ function requireNative() {
235
235
  try {
236
236
  const binding = require('@local-sandbox/lsb-nodejs-freebsd-arm64')
237
237
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-freebsd-arm64/package.json').version
238
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
238
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
240
240
  }
241
241
  return binding
242
242
  } catch (e) {
@@ -256,8 +256,8 @@ function requireNative() {
256
256
  try {
257
257
  const binding = require('@local-sandbox/lsb-nodejs-linux-x64-musl')
258
258
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-x64-musl/package.json').version
259
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
259
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
261
261
  }
262
262
  return binding
263
263
  } catch (e) {
@@ -272,8 +272,8 @@ function requireNative() {
272
272
  try {
273
273
  const binding = require('@local-sandbox/lsb-nodejs-linux-x64-gnu')
274
274
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-x64-gnu/package.json').version
275
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
275
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
277
277
  }
278
278
  return binding
279
279
  } catch (e) {
@@ -290,8 +290,8 @@ function requireNative() {
290
290
  try {
291
291
  const binding = require('@local-sandbox/lsb-nodejs-linux-arm64-musl')
292
292
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-arm64-musl/package.json').version
293
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
293
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
295
295
  }
296
296
  return binding
297
297
  } catch (e) {
@@ -306,8 +306,8 @@ function requireNative() {
306
306
  try {
307
307
  const binding = require('@local-sandbox/lsb-nodejs-linux-arm64-gnu')
308
308
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-arm64-gnu/package.json').version
309
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
309
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
311
311
  }
312
312
  return binding
313
313
  } catch (e) {
@@ -324,8 +324,8 @@ function requireNative() {
324
324
  try {
325
325
  const binding = require('@local-sandbox/lsb-nodejs-linux-arm-musleabihf')
326
326
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-arm-musleabihf/package.json').version
327
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
327
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
329
329
  }
330
330
  return binding
331
331
  } catch (e) {
@@ -340,8 +340,8 @@ function requireNative() {
340
340
  try {
341
341
  const binding = require('@local-sandbox/lsb-nodejs-linux-arm-gnueabihf')
342
342
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-arm-gnueabihf/package.json').version
343
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
343
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
345
345
  }
346
346
  return binding
347
347
  } catch (e) {
@@ -358,8 +358,8 @@ function requireNative() {
358
358
  try {
359
359
  const binding = require('@local-sandbox/lsb-nodejs-linux-loong64-musl')
360
360
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-loong64-musl/package.json').version
361
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
361
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
363
363
  }
364
364
  return binding
365
365
  } catch (e) {
@@ -374,8 +374,8 @@ function requireNative() {
374
374
  try {
375
375
  const binding = require('@local-sandbox/lsb-nodejs-linux-loong64-gnu')
376
376
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-loong64-gnu/package.json').version
377
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
377
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
379
379
  }
380
380
  return binding
381
381
  } catch (e) {
@@ -392,8 +392,8 @@ function requireNative() {
392
392
  try {
393
393
  const binding = require('@local-sandbox/lsb-nodejs-linux-riscv64-musl')
394
394
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-riscv64-musl/package.json').version
395
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
395
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
397
397
  }
398
398
  return binding
399
399
  } catch (e) {
@@ -408,8 +408,8 @@ function requireNative() {
408
408
  try {
409
409
  const binding = require('@local-sandbox/lsb-nodejs-linux-riscv64-gnu')
410
410
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-riscv64-gnu/package.json').version
411
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
411
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
413
413
  }
414
414
  return binding
415
415
  } catch (e) {
@@ -425,8 +425,8 @@ function requireNative() {
425
425
  try {
426
426
  const binding = require('@local-sandbox/lsb-nodejs-linux-ppc64-gnu')
427
427
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-ppc64-gnu/package.json').version
428
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
430
430
  }
431
431
  return binding
432
432
  } catch (e) {
@@ -441,8 +441,8 @@ function requireNative() {
441
441
  try {
442
442
  const binding = require('@local-sandbox/lsb-nodejs-linux-s390x-gnu')
443
443
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-linux-s390x-gnu/package.json').version
444
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
444
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
446
446
  }
447
447
  return binding
448
448
  } catch (e) {
@@ -461,8 +461,8 @@ function requireNative() {
461
461
  try {
462
462
  const binding = require('@local-sandbox/lsb-nodejs-openharmony-arm64')
463
463
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-openharmony-arm64/package.json').version
464
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
464
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
466
466
  }
467
467
  return binding
468
468
  } catch (e) {
@@ -477,8 +477,8 @@ function requireNative() {
477
477
  try {
478
478
  const binding = require('@local-sandbox/lsb-nodejs-openharmony-x64')
479
479
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-openharmony-x64/package.json').version
480
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
480
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
482
482
  }
483
483
  return binding
484
484
  } catch (e) {
@@ -493,8 +493,8 @@ function requireNative() {
493
493
  try {
494
494
  const binding = require('@local-sandbox/lsb-nodejs-openharmony-arm')
495
495
  const bindingPackageVersion = require('@local-sandbox/lsb-nodejs-openharmony-arm/package.json').version
496
- if (bindingPackageVersion !== '0.1.1' && 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.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
496
+ if (bindingPackageVersion !== '0.3.0' && 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.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
498
498
  }
499
499
  return binding
500
500
  } catch (e) {
@@ -557,5 +557,8 @@ if (!nativeBinding) {
557
557
  }
558
558
 
559
559
  module.exports = nativeBinding
560
+ module.exports.ByteStream = nativeBinding.ByteStream
560
561
  module.exports.Sandbox = nativeBinding.Sandbox
561
562
  module.exports.SpawnedProcess = nativeBinding.SpawnedProcess
563
+ module.exports.WatchStream = nativeBinding.WatchStream
564
+ module.exports.initSandbox = nativeBinding.initSandbox
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@local-sandbox/lsb-nodejs",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "Native Node.js bindings for lsb microVM sandboxes",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -96,7 +96,7 @@
96
96
  },
97
97
  "packageManager": "yarn@4.12.0",
98
98
  "optionalDependencies": {
99
- "@local-sandbox/lsb-nodejs-darwin-arm64": "0.1.1",
100
- "@local-sandbox/lsb-nodejs-darwin-x64": "0.1.1"
99
+ "@local-sandbox/lsb-nodejs-darwin-arm64": "0.3.0",
100
+ "@local-sandbox/lsb-nodejs-darwin-x64": "0.3.0"
101
101
  }
102
102
  }