Worker External Node.js Libraries

I’m trying to import Node.js library to perform ML inference inside a worker.
What it the right approach to import any Node.js lib into a worker?

You can import it as you would a standard library. You just need to make sure it works with workers as workers uses V8 and not NodeJS. Only thing I would be careful of is the workers time limit.