Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

How to port NodeJs Module to XSJSLib?

$
0
0

Hi!

 

I'm not a Javascript Guru but I already realized that XS could benefit from importing NodeJs modules.

 

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?

 

Thanks!


Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>