-
Notifications
You must be signed in to change notification settings - Fork 14
Home
WIDL-NAN enables developers to write a Node.js addon with least knowledge to Node.js addon development.
With this WIDL-NAN tool, developers can work out a Node.js addon using pure C++ to work in problem domain, with least knowledge of v8, Node.js & NAN. To achieve that, developers are supposed to define the API exposed in Node.js environment in Web IDL language.
- If you're a C++ developer, and you want your C++ API to be exposed in Node.js environment.
- Or if you're a Node.js developer, and you have to write something in C++ because it can't be done in pure JavaScript.
- If you're not familiar with v8 or Nan
- If you don't want to write many lines in NAN notation for every single API in your Node.js addon
Then you might benefit from this WIDL-NAN tool.
To use WIDL-NAN tool, you'll need to do the following
- Define your Node.js interface in Web IDL Language, written into a file (or multiple files)
- Run WIDL-NAN on that file (or multiple files)
- Run
node-gyp
to build the Node.js addon - Now you'll get a Node.js addon with all the API you defined, but without any real functionalities. It's time you modify the generated skeleton of implementation code, adding the functionalities.
For complete spec and/or examples of Web IDL language, please follow this link.
You can use WIDL-NAN as a command line tool, or use WIDL-NAN as a Node.js module
For the usage of node-gyp
(a Node.js C++ addon build tool), please find it here.
WIDL-NAN
tool only supports a practical subset of WebIDL language. A complete list of supported features can be found in Feature List