Web AppBuilder custom widget how to add third party node modules?

1364
6
05-20-2019 05:41 AM
BrentSlone3
New Contributor III

know that ArcGIS Web AppBuilder Desktop is built using Node.js

Is there any way we can add the third party node.js modules in Web AppBuilder Desktop using the npm command and then access these modules in the custom widget?

For example, I would like to use the npm module: https://www.npmjs.com/package/xlsx In a custom widget

Where do I write the command to download the module?

After downloading the module how do I access it in the custom widget?

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Brent,

   Node is used in Web App Builder but not in any deployed app. Once the app is built it is just a pure JS application and has no access to Node.

0 Kudos
BrentSlone3
New Contributor III

I understand, is there any way to add and access the third party node.js modules while the app is still in ArcGIS Web AppBuilder for Developer/server/app directory?  

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brent,

   I would imagine so, but I have no experience doing that.

EDIT: actually it does not sound promising based on this link:

https://stackoverflow.com/questions/37505938/using-a-third-party-library-in-a-node-application

0 Kudos
RaghavGupta
New Contributor III

Hi Brent 

You can do the same

  1. Just download the js file from below mentioned url if u want to run it locally inside your organisation network . 
  2. After that you can follow the instructions mentione at this url based on your requirement .

If you found it helpful please like the comment . If you find the better solution please reply on top of it

Thanks

diaconori
New Contributor III

In my organisation, that is near impossible because the system administration is run by 60 year olds who believe these JavaScript packages are full of viruses. I've tried to even inject these and then call the code from that, but it doesn't work. I can get far by using ExcelJS, as its the only library that supports AMD, however, the function to write the file back out on client-side doesn't work because it is only supported server side.

0 Kudos
LouieRodriguez
New Contributor III

Was there ever a solution found for this post?

0 Kudos