Blame swig/javascript/README.md

Packit 8fb591
## Requirements
Packit 8fb591
Packit 8fb591
* cmake >= 2.8.12
Packit 8fb591
* swig >= 3.0.0
Packit 8fb591
* node >= 0.10.x < 4.9.0
Packit 8fb591
* npm
Packit 8fb591
* libpcre
Packit 8fb591
Packit 8fb591
## Install
Packit 8fb591
Packit 8fb591
```
Packit 8fb591
$ cmake -DENABLE_STATIC=ON -DGEN_LANGUAGE_BINDINGS=ON -DGEN_JAVASCRIPT_BINDINGS=ON ..
Packit 8fb591
$ make
Packit 8fb591
$ make install #necessary for plugin's
Packit 8fb591
$ cd swig/javascript
Packit 8fb591
$ npm install --unsafe-perm
Packit 8fb591
```
Packit 8fb591
Packit 8fb591
## Test
Packit 8fb591
Packit 8fb591
```
Packit 8fb591
$ node test.js
Packit 8fb591
```
Packit 8fb591
Packit 8fb591
## SWIG
Packit 8fb591
Packit 8fb591
Current SWIG version does not support shared pointer. To correct that at the moment you need to do one thing:
Packit 8fb591
Packit 8fb591
1) Use the latest SWIG master branch with the pull request [Add shared pointer support in javascript](https://github.com/swig/swig/pull/236).
Packit 8fb591
Packit 8fb591
You can build the JavaScript bindings inside docker, for that you can use the [dockerfile](./Dockerfile), it is based on the [dockerfile](https://github.com/sysrepo/sysrepo/blob/master/deploy/docker/sysrepo-netopeer2/platforms/Dockerfile.arch.devel).
Packit 8fb591
Packit 8fb591
More details on SWIG's JavaScript bindings can be found at [SWIG](http://www.swig.org/Doc3.0/Javascript.html#Javascript_node_extensions).
Packit 8fb591
Packit 8fb591
## Usage
Packit 8fb591
Packit 8fb591
To include the node bindings simply use it with.
Packit 8fb591
Packit 8fb591
```
Packit 8fb591
var yang = require("./index")
Packit 8fb591
```