$ cmake -DJAVASCRIPT_BINDING=ON .. $ make $ cd javascript $ npm install --unsafe-perm
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")