Using Rust from within Node.js. Or extending Node.js via N-API using NAPI-RS.

applied.math.coding
6 min readMar 11, 2022

Several ways exists to run Rust code from within Node.js. In this post we will look at a relatively smart one, that is, NAPI-RS.

First of all, for what reason makes it sense to have Node.js calling Rust functions?

This question has many answers and we cannot possible cover all the scenarios. Let me give an…