Skip to content
This repository was archived by the owner on Mar 21, 2026. It is now read-only.

Use ffi-napi, ref-napi, and related Node.js NAPI packages - #11

Open
joelpurra wants to merge 6 commits into
tjfontaine:masterfrom
node-ffi-packager:ffi-napi
Open

Use ffi-napi, ref-napi, and related Node.js NAPI packages#11
joelpurra wants to merge 6 commits into
tjfontaine:masterfrom
node-ffi-packager:ffi-napi

Conversation

@joelpurra

@joelpurra joelpurra commented Mar 7, 2020

Copy link
Copy Markdown

Forked and fixed quite a few more things: https://github.com/node-ffi-packager/node-ffi-generate


Note: includes commits from previous pull-requests. Should be merged to master one by one, but wanted to showcase the stepwise progress and allow for feedback.


  • The original ffi, ref, and ref-* packages are outdated and unmaintained.
  • Fixes build/compatibility problems with Node.js v12+.
  • Uses node-ffi-napi.
  • Uses the dependency injection (DI, -di suffix) versions of ref-* with ref-napi.
  • Tested with Node.js v10 and v12, the currently supported LTS versions.

See

- Since this package both executes and generates code which uses `ref`/`ffi`/`ffi-*` packages, they are added both as developer and peer dependencies.
> Represents a type that was referred to using an elaborated type keyword, e.g., `struct S`, or via a qualified name, e.g.,` N::M::type`, or both.

- Supporting Elaborated types allows for a greatly expanded library generation.
- Relies on corresponding support in `node-libclang`.

See

- https://clang.llvm.org/doxygen/classclang_1_1ElaboratedType.html
- https://github.com/tjfontaine/node-libclang
- https://github.com/joelpurra/node-libclang/tree/support-elaborated-type
- Support for the elaborated type requires the corresponding support in `libclang`.
- If/when the patch gets merged in the upstream `libclang`, the version should be reverted.

See

- https://github.com/tjfontaine/node-libclang
- https://github.com/joelpurra/node-libclang/tree/support-elaborated-type
- The original `ffi`, `ref`, and `ref-*` packages are outdated and unmaintained.
- Fixes build/compatibility problems with Node.js v12+.
- Uses `node-ffi-napi`.
- Uses the dependency injection (DI, `-di` suffix) versions of `ref-*` with `ref-napi`.
- Tested with Node.js v10 and v12, the currently supported LTS versions.

See

- https://github.com/node-ffi-napi
- https://github.com/nodejs/Release
@joelpurra

Copy link
Copy Markdown
Author

See tjfontaine/node-libclang#19.

@joelpurra

Copy link
Copy Markdown
Author

Forked and fixed quite a few more things, might help someone: https://github.com/node-ffi-packager/node-ffi-generate

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant