cancel
Showing results for 
Search instead for 
Did you mean: 

How to use node modules in SAPUI5 Fiori Javascript

UlisesCasal
Explorer
0 Kudos

Hello everyone! I am developing a Fiori app using Javascript and I integrated it with Node.js. Then, I installed the SPPull library (the library I need) with npm and I have it in the node_modules folder, this is the structure of the library:

UlisesCasal_0-1707315626150.png

Source code of library: GitHub - koltyakov/sppull: 📎 Download files from SharePoint document libraries using Node.js withou...

My problem is that I don’t know how to import this library (SPPull) into my view controller (In sap.ui.define). What path should I use? What steps should I follow? Regards.

View Entire Topic
Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

 

you can add any JavaScript library in the manifest.js file:

 

  "dependencies": {
            "libs": {
                "sap.m": {
                    "lazy": false
                },
                "sap.me": {
                    "lazy": false
                },
                "sap.ui.comp": {
                    "lazy": false
                },
                "<External Library>": {
                	"lazy": false
                }
            },
        	"components": {
                "<External Library>": {
                    "lazy": false
                }
            }
        },

 

Don't forget that you move the downloaded external library to the resources folder

You need to register that new component in (registerModulePath) like described here:

https://help.sap.com/saphelp_uiaddon10/helpdata/en/9c/5a9619f69f4a819f91fc89d9ff56f1/content.htm?no_...

 

 

Best,

Edrilan Berisha

SAP S/4HANA Cloud Financials Development

0 Kudos

Hello Edrilan,
I am working in a cap application and I want to use with a pdf generator library in my js controller and if I understood your comment correctly, I should move the library to the resources folder ( which is not present in my cap project tree ), and then reference it in the manifest.json that I have under the /app/appname/webapp folder. I can't really find any resources about this concerning CAPm and I would really appreciate your help