codemp/dist/js
alemi 4be0e3481b
feat(js): multi-platform publishing
added loader index, moved directories around a bit to better work with
napi
2024-09-06 13:56:40 +02:00
..
publish feat(js): multi-platform publishing 2024-09-06 13:56:40 +02:00
build.sh feat(js): new glue hash function 2024-08-27 16:09:44 +02:00
README.md docs: improved cargo docs, rewrote readme 2024-09-05 01:45:48 +02:00

JavaScript bindings

NodeJS allows directly requireing properly formed shared objects, so the glue can live mostly on the Rust side.

Our JavaScript glue is built with napi.

To get a usable shared object just cargo build --release --features=js, however preparing a proper javascript package to be included as dependency requires more steps.

npm

codemp is directly available on npm as codemp.

Building

To build a node package, napi-cli must first be installed: npm install napi-cli.

You can then npx napi build in the project root to compile the native extension and create the type annotations (index.d.ts). A package.json is provided for publishing, but will require some tweaking.