How do I use an npm package in my suitescript?
# general
l
How do I use an npm package in my suitescript?
b
depends on the package
ones designed to run in the browser and node have the best chances of working
they are mostl likely to be in umd format and can be uploaded the the file cabinet to use as a custom module
if its only designed to be used in node, then your best hope is to use a bundler like broweserify or webpack
anything that does i/o is likely to not work, suitescript, node, and browsers all do it differently
l
Do these work in RESTlets?
b
only designed for use in node, though doesnt use i/o
use with a bundler
l
What do you mean by that?
b
that package uses the commonjs module format, which is for use in node
you will need to use a bundler, which is designed to combine all the packages used by your script
bundlers are generally smart enough to combine files in different formats and output into whatever format you want, in your case amd
l
Tahnks I appriciate the help
171 Views