node package manager


Bindings to libclang


node.js module for libclang and parsing c-style source from javascript

var libclang = require('libclang');
var index = new libclang.index();
var tu = new libclang.translationunit();
tu.fromSource(idx, 'myLibrary.h', ['-I/path/to/my/project']);
tu.cursor().visitChildren(function (parent) {
  switch (this.kind) {
    case libclang.KINDS.CXCursor_FunctionDecl:
  return libclang.CXChildVisit_Continue;

This has been moved to its own library npm install -g ffi-generate

See also

Not all of libclang is wrapped yet, but there's enough for ffi-generate to regenerate the dynamic clang bindings.

The native wrapper isn't completely fleshed out or free of errors. Enough is wrapped to allow for C modules to be successfully generated by lib/generateffi.js.