Packages

@emnapi/core

1.11.3 · 25 Jul 2026MIT92.4M / weekRepositoryHomepagenpmAtom feed

Your version

0.43.0

20 Oct 2023Where it was published

0.45.0 is the newest release of 0.43.x.

In short

2 breaking1 new3 fixed1 changed

  • Breaking

    If you are using emnapi.h, it should be included after including js_native_api.h or node_api.h

  • Breaking

    onCreateWorker(info: { type: 'pthread' | 'async-work' }) has been changed to onCreateWorker(info: { type: 'thread' | 'async-work' })

Release note

What's Changed

  • Enable uncaught exceptions policy by default

  • Run finalizers directly from GC

  • Add missing CHECK_ARG(env, cbinfo); to napi_create_function and napi_get_new_target

  • Wrap napi_get_array_length and napi_get_prototype with PREAMBLE

  • Do not include js_native_api.h in emnapi.h

Breaking Changes

  • Breaking

    If you are using emnapi.h, it should be included after including js_native_api.h or node_api.h

    + #include <js_native_api.h> // or #include <node_api.h>
      #include <emnapi.h>
  • Breaking

    onCreateWorker(info: { type: 'pthread' | 'async-work' }) has been changed to onCreateWorker(info: { type: 'thread' | 'async-work' })

      const { instantiateNapiModule } = require('@emnapi/core')
    
      instantiateNapiModule({
        // ...
        onCreateWorker ({ type }) {
    -     if (type === 'pthread') {
    +     if (type === 'thread') {
          // ...
          }
        }
      })

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.