@napi-rs/wasm-runtime
Advanced tools
+7
-4
| { | ||
| "name": "@napi-rs/wasm-runtime", | ||
| "version": "1.1.6", | ||
| "version": "1.2.0", | ||
| "type": "module", | ||
| "description": "Runtime and polyfill for wasm targets", | ||
| "engines": { | ||
| "node": "^20.19.0 || ^22.13.0 || >=23.5.0" | ||
| }, | ||
| "homepage": "https://napi.rs/", | ||
@@ -37,3 +40,3 @@ "author": { | ||
| "events": "^3.3.0", | ||
| "memfs": "^4.57.6", | ||
| "memfs": "^4.64.0", | ||
| "node-inspect-extracted": "^3.3.2", | ||
@@ -51,4 +54,4 @@ "path-browserify": "^1.0.1", | ||
| "peerDependencies": { | ||
| "@emnapi/core": "^1.7.1", | ||
| "@emnapi/runtime": "^1.7.1" | ||
| "@emnapi/core": "^2.0.0-alpha.3", | ||
| "@emnapi/runtime": "^2.0.0-alpha.3" | ||
| }, | ||
@@ -55,0 +58,0 @@ "scripts": { |
+24
-2
@@ -1,3 +0,22 @@ | ||
| const { MessageHandler, instantiateNapiModuleSync, instantiateNapiModule } = require('@emnapi/core') | ||
| const { getDefaultContext } = require('@emnapi/runtime') | ||
| const { | ||
| MessageHandler, | ||
| instantiateNapiModuleSync, | ||
| instantiateNapiModule, | ||
| } = require('@emnapi/core') | ||
| // Single-threaded (non-shared-memory) WASI builds link an emnapi archive | ||
| // without the C async-work and threadsafe-function implementations (they are | ||
| // unconditional `napi_generic_failure` stubs without threads), so the | ||
| // generated loaders provide the JavaScript implementations through these | ||
| // plugins instead. Raw `instantiateNapiModule(Sync)` callers instantiating a | ||
| // single-threaded napi-rs wasm must pass them too: | ||
| // `plugins: [emnapiAsyncWorkPlugin, emnapiTSFNPlugin]` — without them | ||
| // instantiation fails with a LinkError naming the missing import. Threaded | ||
| // (shared-memory) builds link the C implementations and need no plugins; | ||
| // this mirrors the upstream @emnapi/core v2 plugin split (v1 bundled these | ||
| // implementations in the core runtime). | ||
| const { | ||
| asyncWork: emnapiAsyncWorkPlugin, | ||
| tsfn: emnapiTSFNPlugin, | ||
| } = require('@emnapi/core/plugins') | ||
| const { createContext, getDefaultContext } = require('@emnapi/runtime') | ||
| const { WASI } = require('@tybys/wasm-util') | ||
@@ -9,2 +28,5 @@ | ||
| MessageHandler, | ||
| createContext, | ||
| emnapiAsyncWorkPlugin, | ||
| emnapiTSFNPlugin, | ||
| instantiateNapiModule, | ||
@@ -11,0 +33,0 @@ instantiateNapiModuleSync, |
+16
-1
@@ -6,4 +6,19 @@ export { | ||
| } from '@emnapi/core' | ||
| export { getDefaultContext } from '@emnapi/runtime' | ||
| // Single-threaded (non-shared-memory) WASI builds link an emnapi archive | ||
| // without the C async-work and threadsafe-function implementations (they are | ||
| // unconditional `napi_generic_failure` stubs without threads), so the | ||
| // generated loaders provide the JavaScript implementations through these | ||
| // plugins instead. Raw `instantiateNapiModule(Sync)` callers instantiating a | ||
| // single-threaded napi-rs wasm must pass them too: | ||
| // `plugins: [emnapiAsyncWorkPlugin, emnapiTSFNPlugin]` — without them | ||
| // instantiation fails with a LinkError naming the missing import. Threaded | ||
| // (shared-memory) builds link the C implementations and need no plugins; | ||
| // this mirrors the upstream @emnapi/core v2 plugin split (v1 bundled these | ||
| // implementations in the core runtime). | ||
| export { | ||
| asyncWork as emnapiAsyncWorkPlugin, | ||
| tsfn as emnapiTSFNPlugin, | ||
| } from '@emnapi/core/plugins' | ||
| export { createContext, getDefaultContext } from '@emnapi/runtime' | ||
| export * from '@tybys/wasm-util' | ||
| export { createOnMessage, createFsProxy } from './fs-proxy.js' |
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
6392948
2.14%1645
2.3%