tree: efea86be4858a35552969fc28cf132d55d49e9cc [path history] [tgz]
  1. CMakeLists.txt
  2. Dockerfile
  3. README.md
  4. binding.gyp.in
  5. files/
  6. index.js.in
  7. libyang_javascript.i
  8. package.json.in
  9. run.sh
  10. test.js.in
swig/javascript/README.md

Requirements

  • cmake >= 2.8.12
  • swig
  • node >= 0.10.x
  • npm

Install

$ cmake -DJAVASCRIPT_BINDING=ON ..
$ make
$ make install #necessary for plugin's
$ cd javascript
$ npm install --unsafe-perm

node 7.0.x

The latest SWIG library does not generate correct node 7.0.x code. To correct that at the moment you need to do two things:

  1. Use the latest SWIG master branch with the pull request Add Node 7.x aka V8 5.2+ support.
  2. In the generated C++ source file libyang_javascript_wrap.cxx replace 'lys_ext_instance_complex()' with 'lys_ext_instance_complex'.

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.

Usage

To include the node bindings simply use it with.

var yang = require("./index")