Tools to generate Typescript FFI bindings for C/C++ libraries using libclang and ffi-napi.
- clangffi cli tool to generate Typescript bindings.
- libclang-bindings library for libclang bindings.
- Generates Typescript typings and ref-napi types.
- Bring your own
libclang
binary. - Validated against llvm-project 13.0.0.
See the following packages for more information:
- clangffi - cli tool for generating bindings
- libclang-bindings - libclang bindings for node
Contributions are welcome, but guidelines for how to get involved are not in place yet. As a result, please start by opening an issue. Thanks for your interest!
- This project contains a
.prettierrc
configuration file to help your editor contribute consistent code. Forvscode
, use this extension. - We use conventional commits to help with automatic semantic versioning. Please ensure your commit messages follow this format.
npm run bootstrap
to bootstrap the project.npx lerna add <dep> packages/<project> [--dev]
to add a dep (--dev
makes it a dev dep).npm run build
builds all packages.npm run clangffi
runs clangffi (remember to build first).npm run generate-dogfood
re-generates our libclang bindings usinglibclang-bindings
(ourself).
To get started:
# clone and enter the project directory
git clone --config core.autocrlf=false --recursive https://github.com/rainwayapp/node-clangffi.git
cd node-clangffi
# install deps
npm i
# bootstrap and build
npm run bootstrap && npm run build
# bootstrap once last time to ensure typings are present
npm run bootstrap