- cmake >= 2.8.12
- swig >= 3.0.0
- node >= 0.10.x < 4.9.0
- npm
- libpcre
$ cmake -DENABLE_STATIC=ON -DGEN_LANGUAGE_BINDINGS=ON -DGEN_JAVASCRIPT_BINDINGS=ON ..
$ make
$ make install #necessary for plugin's
$ cd swig/javascript
$ npm install --unsafe-perm
$ node test.js
Current SWIG version does not support shared pointer. To correct that at the moment you need to do one thing:
- Use the latest SWIG master branch with the pull request Add shared pointer support in javascript.
You can build the JavaScript bindings inside docker, for that you can use the dockerfile, it is based on the dockerfile.
More details on SWIG's JavaScript bindings can be found at SWIG.
To include the node bindings simply use it with.
var yang = require("./index")