# napi-rs

> A framework for building compiled Node.js add-ons in Rust via Node-API

Source: https://talira.ai/catalog/napi-rs-ka76jrjv
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Framework, Library, Command-line tool
- Categories: [developer tools / language bindings](https://talira.ai/categories/developer-tools/language-bindings), [languages / rust](https://talira.ai/categories/languages/rust), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [NAPI-RS](https://talira.ai/orgs/napi-rs.md)
- Creator: LongYinan

napi-rs is a framework for writing pre-compiled Node.js add-ons in Rust through Node-API. Annotating Rust functions and structs with #[napi] generates the JavaScript bindings and TypeScript type definitions, and the napi CLI builds the add-on with no hand-written glue, cross-compiles it for other platforms, sets up CI and publishes a package per platform to npm. It can also compile the same code to WebAssembly, and its API design manages lifetimes for safety. It's released under the MIT licence.

## Links

- Website: https://napi.rs/
- GitHub: https://github.com/napi-rs/napi-rs
- Docs: https://napi.rs/docs/introduction/getting-started

## Problems it solves

- write the slow part of my Node.js library in Rust and call it from JavaScript
- ship a native Node.js add-on with prebuilt binaries so users don't need a compiler
- generate TypeScript types for my Rust bindings automatically
- cross-compile my Rust Node module for Linux, macOS, Windows and ARM in CI
- run the same Rust code natively in Node.js and as WebAssembly in the browser

## Features

- #[napi] macros generate JavaScript bindings and TypeScript definitions
- napi build: zero-config build of the add-on
- Cross-compilation for many platforms
- CI templates and per-platform npm packages
- WebAssembly target from the same code
- Lifetime-managed, safer API design

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.75 out of 1.
Signals: maintenance 1.00, adoption 0.78, momentum 0.57, community 0.92, backing 0.50, extensibility 0.20.

- last commit 6 days ago
- 236 commits in the last 90 days
- latest release napi-async-runtime-v0.2.11 6 days ago
- 8.1k GitHub stars
- 196 contributors
- accepts sponsorship (Github, Github, Github)
- has a company behind it
- created by LongYinan

## Alternatives

- [bindgen](https://talira.ai/catalog/bindgen-8awz7b66.md): Generates Rust FFI bindings to C and some C++ libraries from their headers
- [wasm-bindgen](https://talira.ai/catalog/wasm-bindgen-r2y6dgby.md): Generates the glue between Rust WebAssembly modules and JavaScript
- [flutter_rust_bridge](https://talira.ai/catalog/flutter-rust-bridge-5cp1d45d.md): Call Rust code from Flutter and Dart, with the glue code generated for you

## Sources

[^1]: https://github.com/napi-rs/napi-rs/blob/main/LICENSE (checked 25 Nov 2026)
