How to port NodeJs Module to XSJSLib?
I want to use a node module called "schema-inspector" in a XSJS file I'm developing but actually this question applies for any nodejs module.
There is no 'require' or 'module' namespace on XSJS (at least yet) so I **think** that it's not possible to port a Node module without adjusting its code (mainly the exports part). Am I right?
I know Jasmine was ported to a XSJSLib on SPS 09 and comparing Jasmine version 2.0 with core2.xsjslib file from testtools package it seems SAP developers had a lot of work to make this works.
If there is no easy way to port it, I'm thinking about changing the module and actually creating its "core" object inside the $ namespace. Is this the "right" or at least the good way of doing this? Of course the module extension will have to be renamed to xsjslib.
Rumor has it a future SPS of Hana will have support to NodeJS... is this true? While I'm on SPS 9, what should I do?
Thomas Jung replied
Yes we are working on NodeJS support as we speak. We already have internal builds running NodeJS. That said, this is a forward facing, roadmap comment and comes with all the legal disclaimers. If everything goes as planned we hope to introduce NodeJS support with SPS 11 at the end of this calendar year. Then you will be able to use require to directly use NodeJS modules.