# What changed in napi

> 116 changes in napi 3 from its official release notes, upgrade guides and advisories: 21 breaking, 1 deprecations, 8 security, 16 new APIs and options. Each one cited. Sources checked 2026-11-23. HTML: https://unstale.sh/cargo/napi/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## napi 3

### Breaking changes

- Builds without type tags now reject a value of another class. (3.15.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.15.0)
- Conversion depth is bounded at 128 levels. (3.14.2) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.14.2)
- Addons with live native code are no longer unloaded. (3.12.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.1)
- The Rust version requirement is bumped. (3.4.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.4.0)
- The new @napi-rs/cli requires Node.js ^20.17.0 || ^22.13.0 || >=23.5.0 at build time; this does not change the runtime support of the shipped addon. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- The compat-mode module_exports macro is replaced by #[napi(module_exports)]. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Path flags are now resolved relative to --cwd or process.cwd(), rather than --cargo-cwd or process.cwd(). (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- The --cargo-cwd flag is removed; use --manifest-path to point to the crate's Cargo.toml. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- The --cargo-flags option is removed; pass Cargo flags after -- instead. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Use --manifest-path to point at the crate's Cargo.toml in place of --cargo-cwd. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Arguments after -- are forwarded to cargo build, allowing Cargo flags such as --locked to be passed through. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- The command is renamed to napi create-npm-dirs. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Use napi_derive::module_init in place of napi::module_init. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Use this macro in place of the compat-mode module_exports macro; it accepts the documented signature. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- The module_init macro moved from napi to napi_derive. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- The command is renamed to napi universalize. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Use napi universalize in place of napi universal. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Move the package name from napi.package.name to napi.packageName; v3 does not read the old nested field. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Use a flat targets array listing every target explicitly, including targets formerly supplied by defaults. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Rust 1.88 or newer is required for the v3 migration. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- ThreadsafeFunction has been rewritten, replacing its ref-count lifecycle with ownership-based behavior. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)

### Security

- Native payload provenance is now validated for External and instance data. (3.13.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.13.0)
- External-buffer slices now point at the engine-owned copy after finalization reclaims the source; this also affects TypedArraySlice::from_external, Uint8ClampedSlice::from_external, and compat-mode Env::create_arraybuffer_with_borrowed_data. (3.12.4) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.4)
- Wrapped payload provenance is validated before dereferencing in Object::unwrap and Object::remove_wrapped, and the deprecated Env::unwrap and Env::drop_wrapped, preventing out-of-bounds memory access. (3.12.4) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.4)
- Unexpected JavaScript value shapes now return errors instead of reaching unreachable!() and aborting the process. (3.12.4) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.4)
- Fixes a memory safety issue in PromiseRaw callbacks. (3.12.2) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.2)
- Fixes a WASI double-free involving zero-copy external strings. (3.9.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.9.1)
- Prevents async iterator use-after-free during garbage collection. (3.8.3) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.3)
- JsObject and the listed legacy JsValue types are behind compat-mode; migrate to the new APIs because these APIs are not safe. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)

### Deprecations

- The triples configuration is replaced by napi.targets; v3 still reads triples for compatibility, but new projects should not use it. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)

### New APIs and options

- Class members can use symbol_for keys. (3.16.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.16.0)
- Class members can use well-known symbol keys. (3.16.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.16.0)
- A ReadableStream can now be canceled through its Reader. (3.15.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.15.0)
- The MultiThread flavor is now available on wasm32-wasip1-threads. (3.13.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.13.0)
- Adds support for a pluggable async runtime backend. (3.11.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.11.0)
- Implementations are available for OsString, OsStr, Path and PathBuf, enabling conversions between these Rust types and napi values. (3.10.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.10.0)
- Adds a method to handle errors in callback functions. (3.9.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.9.0)
- Adds the #[napi(async_iterator)] macro attribute. (3.8.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.0)
- ArrayBuffer now provides unsafe as_mut, allowing mutable access to its contents. (3.7.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.7.0)
- Promise.resolve and Promise.reject are now supported. (3.7.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.7.0)
- Adds Eq and PartialEq trait implementations to BigInt. (3.6.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.6.0)
- Adds support for using node_api_create_object_with_properties for enum creation. (3.6.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.6.0)
- The napi-derive tracing feature enables debug logging of NAPI function calls. (3.6.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.6.0)
- Adds on_abort support for AbortSignal. (3.4.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.4.0)
- Enable the compat-mode feature to keep using deprecated types during an incremental migration; it is not recommended as a permanent state because those types have known safety issues. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)
- Use napi.binaryName instead of napi.name for the binary name; napi.name remains readable for compatibility, but new projects should use binaryName. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)

### Behavior and default changes

- Classes marked with #[napi] have unforgeable identity via Node object type tags. (3.11.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.11.0)
- Stream now supports any object types. (3.8.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.0)
- Promise no longer requires tokio. (3.5.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.5.1)
- ThreadsafeFunction::call_async no longer requires tokio. (3.5.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.5.1)
- N-API symbols are loaded at runtime on all platforms using libloading. (3.5.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.5.0)
- PromiseRaw is now public. (3.5.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.5.0)
- SendableResolver is now public. (3.5.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.5.0)
- The tsfn data is now public. (3.5.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.5.0)

### Tooling

- The CLI now supports non-threaded WASI targets. (3.12.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.0)
- The CLI now supports the loongarch64-unknown-linux-gnu target. (3.4.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.4.0)
- Use the renamed command to create npm/* directories in CI instead of committing those directories. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)

### Fixes and other changes

- AsyncTask promises no longer leak. (3.16.2) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.16.2)
- Teardown is handled per environment for multi-load addons. (3.16.2) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.16.2)
- Avoids a deadlock when a worker loads the addon during block_on. (3.16.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.16.1)
- Avoids TS1016 in constructors. (3.16.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.16.0)
- Registered classes are kept when a later load fails. (3.16.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.16.0)
- Static flags are now honored when defining classes. (3.16.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.16.0)
- Borrowed class arguments are kept alive across AsyncTask and AsyncBlock. (3.15.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.15.0)
- Failed conversion now drops an unadopted class value and resets the factory flag. (3.15.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.15.0)
- The custom GC aborted flag is set before Node closes its tsfn. (3.15.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.15.0)
- Managed array inputs are now copied. (3.15.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.15.0)
- Fixed ReadableStream::cancel. (3.15.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.15.0)
- Tokio runtime threads are joined at environment teardown. (3.15.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.15.0)
- Fixed TypedArray input leaks and compat buffer copies on wasm. (3.15.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.15.0)
- Registers wasm cleanup through the environment cleanup hook. (3.14.2) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.14.2)
- Objects are now created with napi_define_properties on every Node version. (3.14.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.14.1)
- The allocator is locked on threaded WASI, preventing hangs after a worker crash. (3.14.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.14.0)
- AsyncTask completion is guarded against environment teardown. (3.12.7) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.7)
- Outstanding async work is drained before the WASI binding is disposed. (3.12.6) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.6)
- Fixed fatal_exception being a no-op in optimized builds. (3.12.5) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.5)
- Converting errors keeps the anyhow error cause. (3.12.3) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.3)
- Fixed Buffer detachment in threadless wasm. (3.12.3) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.3)
- Panics in closure trampolines are caught instead of causing an abort. (3.12.3) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.3)
- Fixed waker-stack deadlocks in CurrentThread. (3.12.3) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.3)
- Module registration no longer uses randomness in wasi. (3.12.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.1)
- Non-Error rejections are preserved. (3.12.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.1)
- A teardown barrier is added for wasm. (3.12.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.12.1)
- FunctionRef is released off the JS thread via the custom-GC TSFN. (3.10.5) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.10.5)
- The CLI aligns build and project configuration. (3.10.4) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.10.4)
- Preserves the JavaScript error object when cloning an Error off-thread. (3.10.3) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.10.3)
- Cloning a JavaScript exception Error off-thread now preserves its message and cause. (3.10.2) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.10.2)
- Release Error's exception reference through the custom GC when the Error is dropped off-thread. (3.10.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.10.1)
- Stop retaining the exception object in the sync-throw path on wasm targets. (3.10.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.10.1)
- Custom-GC Buffer and TypedArray drops on another thread are routed through the owning isolate. (3.10.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.10.0)
- Changes field-error decoration for napi object attributes. (3.9.4) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.9.4)
- Synchronizes the referred flag when creating a weak ThreadsafeFunction. (3.9.3) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.9.3)
- Fixed the Reader losing chunks and aborting on errored streams. (3.9.2) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.9.2)
- Fixes the experimental node_api_create_object_with_properties API. (3.9.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.9.1)
- Corrects the error message typo from “non” to “none.” (3.8.5) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.5)
- Error::cause is populated from ThreadsafeFunction callee-handled callbacks. (3.8.5) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.5)
- Generator class methods are preserved. (3.8.5) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.5)
- Callback errors are handled gracefully during shutdown. (3.8.5) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.5)
- Conversion now checks for a null error_message. (3.8.4) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.4)
- Conversion from Unknown now skips nullish error causes. (3.8.4) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.4)
- Implemented TypeName for ArrayBuffer. (3.8.2) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.2)
- Fixed a memory leak in async functions. (3.8.2) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.2)
- Fixed a compile error when compiling for WASI in debug mode. (3.8.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.1)
- Validates status before copying in the ToNapiValue fallback. (3.8.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.0)
- Validates status before copying data in the env arraybuffer fallback. (3.8.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.0)
- Validates status before copying in the owned ToNapiValue fallback. (3.8.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.0)
- Validates status before copying in the remaining TypedArray fallback paths. (3.8.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.8.0)
- Fixes BigInt comparison. (3.6.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.6.0)
- Makes the NODE_VERSION_* items public again. (3.6.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.6.0)
- Restores non dyn-symbols behavior. (3.6.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.6.0)
- Fixes runtime shutdown at environment cleanup on Windows. (3.6.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.6.0)
- Fixed TypedArraySlice creation. (3.5.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.5.1)
- Fixes a memory leak in the PromiseRaw cleanup callback. (3.5.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.5.0)
- Cleans up memory issues. (3.4.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.4.0)
- Fixes node_api_create_external_string_utf16 on wasm. (3.4.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.4.0)
- Stops a reference error object on wasm targets. (3.4.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-v3.4.0)
