RE: How to import external library with multiple files
I want to access an external library as part of one of my scripts:
https://github.com/auth0/node-jsonwebtoken
I’ve read several guides showing how to upload a single .js file to the file cabinet and refer to it via it’s relative path, however I’m at a loss as to what to do when I want to use a multi-file library like this.
Your primary problem will be that node-jsonwebtoken was written to run on node, as you can guess from the name. It uses a different module system than netsuite, specifically common js instead of amd. There are bundling tools like browserify or webpack that can bundle common js imto different module formats. It may or may not work depending on which node modules that library uses.