Hello, is it possible to use an npm module in Suitescript?
s
stalbert
01/26/2021, 8:01 PM
sure, I look to use prewritten libraries (npm modules) whenever possible in order to improve solution quality.
a
Ava
01/26/2021, 8:11 PM
Yes, libraries are great. I was under the impression that I can only use a plain .js file as a library and I wasn't sure if I can use get an npm module as a js file?
b
battk
01/26/2021, 8:32 PM
Most npm modules are js
battk
01/26/2021, 8:33 PM
Your primary problem will be that most modules are written for use in browsers or node
battk
01/26/2021, 8:35 PM
Code that uses browser globals or node core modules tends to fail in suitescript since neither of those two things exist
a
Ava
01/26/2021, 8:38 PM
Got it, thank you so much!
b
battk
01/26/2021, 8:40 PM
As an example, there is a pdf npm module recommendation in a thread from about 12 hours ago
battk
01/26/2021, 8:41 PM
Its unlikely to work in suitescript since it requires the node fs module