Can we use node-fetch or the https functionality in a widget

We have a widget that sends data to gov notify using curl (cs.curl).
We’re having some problems with non-ascii characters and I wondered if I can use “https” or “node-fetch”.
I’ve tried a “require” but it didn’t work.