Back to Explore

toyobayashi/emnapi

GitHub
6 updates · last 90 days2 watchersOpen source

Last release:

emnapi is a Node-API implementation intended for running native Node-API addons on WebAssembly targets. It helps port Node-API native addons to Emscripten, wasi-sdk, clang wasm32 (including pthread/thread support), while aiming to match native Node.js runtime behavior closely. It also powers the WebAssembly feature for napi-rs and provides documentation and guides for building and using it.

Project status

  • Actively maintained. GitHub activity is very recent (last upstream push 2026-07-03) and updates continue through the last month (v1.11.2 on 2026-07-03, v1.11.1 and v1.11.0 on 2026-06-13 and 2026-06-08, respectively).
  • Apparent update cadence is steady but variable. Recent updates landed within weeks (June to early July), followed by slower gaps earlier (for example, v1.10.0 on 2026-04-16, v1.9.x through March). Net effect, the project is in an active development phase rather than a long quiet period.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v1.11.2

    v1.11.2 is a small patch release focused on correcting how `setImmediate` is captured and invoked in the runtime. The main behavior change is binding the `setImmediate` function to the global receiver to avoid issues when the runtime’s global reference differs.

  • v2.0.0-alpha.2

    v2.0.0-alpha.2 is documented as a refactor that removes usage of PThread.runningWorkers. The actual diff is much broader, including TypeScript API shape changes, new plugin-related types/options, and significant build and ABI-facing header/linker changes for the native core.

  • v1.11.1

    Release v1.11.1 is described as a backport fix for refreshing a stale SharedArrayBuffer-backed memory buffer before atomic access. However, the actual diff includes additional API and build/runtime changes (notably TypeScript type signature changes and new thread-related exports) that are not mentioned in the release notes.

    Features
  • v1.11.0

    v1.11.0 adds support for external SharedArrayBuffer creation and expands typed array handling to work with SharedArrayBuffer. It also refactors thread worker management to avoid using PThread.runningWorkers. The code diff, however, includes additional API and configuration changes that are not mentioned in the release notes.

    BreakingFeatures
  • v2.0.0-alpha.1

    v2.0.0-alpha.1 makes major platform and packaging changes, including switching JavaScript packages to ESM-only. It also significantly adjusts worker and async execution internals and changes build outputs (for example, removal of prebuilt wasm target libraries). Additionally, the public TypeScript surface in @emnapi/core changes around worker initialization and plugin extensibility.

    BreakingFeatures
  • v1.10.0

    v1.10.0 focuses on fixing wasm memory growth behavior and improving JS-side TSFN (threadsafe function) coalescing. It also includes CI workflow restructuring and builds targeting LLVM 22. The core runtime changes revolve around external memory accounting and more accurate handling of shared/wasm memory state.

    Breaking
  • v1.9.2

    v1.9.2 is a targeted maintenance release focused on enabling support for a 4GB maximum memory configuration. The release notes only mention this one change, but the code diff shows additional behavior adjustments around unsigned length/pointer handling and async worker resolution.

  • v1.9.1

    v1.9.1 is a patch release that claims to include a fix related to Emscripten 5.0.3. The diff shows build workflow changes to use EM_VERSION 5.0.3 and a change in the Emscripten ESM library transform logic, plus routine version bumps across packages and the emnapi header.

  • v1.9.0

    v1.9.0 focuses on stability fixes for emnapi's thread synchronization, plus an internal refactor of async work dispatch to reduce deadlocks when the main thread blocks. The release notes also document a rename of the experimental object-property creation API and the addition of a `requiredConfig` export to help consumers configure the required wasm toolchain flags.

    BreakingFeatures
  • v1.8.1

    v1.8.1 primarily adds support for Float16Array as a new TypedArray type in emnapi. The codebase also includes a few additional type and build-related adjustments that are not mentioned in the release notes.

    Features
  • v1.8.0

    v1.8.0 introduces support for the experimental Node-API function node_api_set_prototype. The release notes only mention this one new API, while the code diff also includes additional header macro gating and several internal test adjustments.

    Features
  • v1.7.1

    v1.7.1 introduces support for creating DataView instances from SharedArrayBuffer in napi_create_dataview, and it updates how the project enables or detects Node-API experimental behavior. The diff also shows multiple build and header-organization changes that could affect developers compiling against the public headers.

    Features
  • v1.7.0

    v1.7.0 adds support for the Node-API method `napi_create_object_with_properties`. The release notes mention only this feature, but the code diff shows it is implemented as an experimental API and is gated behind `NAPI_EXPERIMENTAL` in the C headers.

    Features
  • v1.6.0

    v1.6.0 adds experimental SharedArrayBuffer support to emnapi, including new N-API style entry points for detecting and creating SharedArrayBuffer instances. It also updates the native API header so napi_delete_reference uses node_api_basic_env, and adjusts CI/release workflow behavior for publishing.

    BreakingFeatures