#napi #nodejs #node #native-bindings #ffi

sys nodejs-sys

Native bindings to the nodejs' n-api

14 breaking releases

0.15.0 Apr 22, 2023
0.14.0 Oct 8, 2022
0.13.0 Mar 27, 2021
0.11.0 Oct 29, 2020
0.1.1 May 6, 2019

#30 in #napi

Download history 46/week @ 2024-08-23 53/week @ 2024-08-30 11/week @ 2024-09-06 75/week @ 2024-09-13 90/week @ 2024-09-20 55/week @ 2024-09-27 40/week @ 2024-10-04 9/week @ 2024-10-11 16/week @ 2024-10-18 21/week @ 2024-10-25 4/week @ 2024-11-01 6/week @ 2024-11-08 13/week @ 2024-11-15 11/week @ 2024-11-22 3/week @ 2024-11-29 24/week @ 2024-12-06

51 downloads per month
Used in 2 crates

MIT license

10KB
55 lines

Rust build crates.io badge docs.rs badge

nodejs-sys

Bindings for NodeJS' N-API.

Requirements

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.

Features

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)

Updates

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.

Usage

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

~0–1.9MB
~37K SLoC