Load an NPM module

https://actions.getdrafts.com/a/1Et

Won’t work for everything, obviously, but let me know if a basic code package isn’t loading.

1 Like

That’s pretty nifty. I can see this being a potential performance issue to load the library from the web every time it’s used in an action, but likely not too noticeable for smaller modules.

Yeah, it ends up being just a single text .js file served from a fast cdn, usually a half-second to run. Loading one module that recursively loaded about 10 others only took 3-4 seconds. But still yes, best just for small utility packages.

If you wanted to get fancy, you could extend it by saving the download to a local cache file with FileManager.write, and load that version if it exists.