LogoPear Docs

Native addons

Loading native code into Bare for work JavaScript can't naturally express, and building prebuilt binaries for every platform you ship to.

For code that JavaScript can't naturally express—tight cryptography loops, codec work, hardware access—Bare loads native addons. The bare-addon template is the starting point: write the addon in C, C++, Rust, or any language with a C-compatible ABI, expose it through Bare's addon API, and call it from JavaScript like any module.

See bare-addon-resolve for the low-level resolution algorithm, and bare-make for the build tool addons compile with.

Building prebuilt binaries

Shipping an addon to users means compiling it for every platform and architecture you support, not just your own machine. Native-addon CI prebuilds covers the GitHub Actions pipeline—compile-prebuilds, upload-prebuilds, download-prebuilds, merge-prebuilds, and the toolchain setup actions they depend on—that runs bare-make across a CI matrix and collects the results.

See also

On this page