#ffi #node #nodejs #napi #n-api

sys nodejs-sys

Native bindings to the nodejs' n-api

13 breaking releases

0.14.0 Oct 8, 2022
0.13.0 Mar 27, 2021
0.12.0 Feb 21, 2021
0.11.0 Oct 29, 2020
0.1.1 May 6, 2019

#6 in #n-api

Download history 68/week @ 2022-11-27 39/week @ 2022-12-04 64/week @ 2022-12-11 59/week @ 2022-12-18 37/week @ 2022-12-25 132/week @ 2023-01-01 51/week @ 2023-01-08 37/week @ 2023-01-15 43/week @ 2023-01-22 155/week @ 2023-01-29 61/week @ 2023-02-05 91/week @ 2023-02-12 241/week @ 2023-02-19 33/week @ 2023-02-26 105/week @ 2023-03-05 46/week @ 2023-03-12

429 downloads per month
Used in neon-runtime

MIT license

55 lines

Rust build crates.io badge docs.rs badge


Bindings for NodeJS' N-API.


This crate needs llvm at build-time, since it generates bindings at build-time (by using bindgen).

For Debian/Ubuntu that's a simple apt install llvm libclang-dev.


Different API versions may be selected via feature-flag. See the N-API Version Matrix for details.

  • napi_v5 supported by all actively maintained NodeJS releases
  • napi_v6 supported by all actively maintained NodeJS releases
  • napi_v7 supported by all actively maintained NodeJS releases
  • napi_v8 requires at least 15.12.0, this is the default (if no flag is given)
  • the experimental N-API features may be enabled via feature flag experimental (off by default)


Not all NodeJS Versions change the N-API, so nodejs-sys gets an update only if the relevant headers have been changed between node versions.

See the (autogenerated) changelog for links to detailed upstream commits.


This crate is very low-level. See neon, they provide N-API Support.

But of course you may also use this crate directly, LogRocket has a nice blog post: Rust and Node.js: A match made in heaven.

No runtime deps

~32K SLoC