node-webidl
v0.1.4
Published
Bindings generator for Node Addons given a WebIDL document
Downloads
5
Readme
Node WebIDL
Bindings generator for Node Addons given a WebIDL document.
Installation
$ npm install --global node-webidl
Usage
Generate a Node Addon binding given a C header and annotated Web IDL.
$ webidl-bind [options] [files]
Options
| | |
| -------------------------- | --- |
| -V, --version
| print the version number |
| -o, --out-file <path>
| redirect generated output to a file |
| -h, --help
| print usage information |
Binding to C
Given a C source implementation file, e.g. add.h
:
float addition(float x, float y) {
return x + y;
}
Write a Web IDL interface describing how to interop with Node, e.g. add.webidl
:
[Bind="add.h"]
interface Add {
[Bind="addition"]
float add(float x, float y);
};
Generate bindings:
$ webidl-bind -o add.c add.webidl
License
Copyright © 2020 Chance Snow. All rights reserved.