npm / emnapi
emnapi
What changed in emnapi 1, from its official release notes, upgrade guides and advisories. Also covers @emnapi/core, @emnapi/runtime. Sources checked 2026-10-19.
2 breaking1 security6 new APIs and options6 behavior and defaults8 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initemnapi 123 changes
Breaking changes 2
The captured setImmediate is now bound to the global receiver.
The API is renamed.
Security 1
Fixes a data race and use-after-free, and fixes thread-safe functions not working in JavaScript-based async_work workers.
New APIs and options 6
Adds napi_create_external_sharedarraybuffer.
Adds requiredConfig to the package entry, exposing required configuration hints such as clang.wasmld.
Adds support for Float16Array.
Adds the node_api_set_prototype API.
Adds the napi_create_object_with_properties method.
Added the SharedArrayBuffer API.
Behavior and default changes 6
Supports SharedArrayBuffer in napi_create_typedarray.
Allows maximum memory of 4GB.
The libraries now include libuv symbols.
Spawning an async worker in JavaScript uses pthread_create instead of maintaining a separate worker pool.
napi_create_dataview supports SharedArrayBuffer.
Changed napi_delete_reference to use node_api_basic_env.
Fixes and other changes 8
Deferred state is defined as own properties.
Memory views are refreshed after unshared memory growth.
Refreshes a stale shared memory buffer before atomic access.
Calling napi_adjust_external_memory no longer grows wasm memory.
Wasm memory is updated earlier for views, addressing the shared-memory grow issue.
Dispatches the async work queue in shared memory to avoid deadlocks when the main thread waits for queued work to start.
Fixes pthread_create not working in JavaScript-based async_work workers.
The finalizer executes after the queue drains when the thread-safe function is aborted.