Using node / npm libraries


#1

Hi, quick question - is it possible to use the require field to import node packages, say ‘mysql’?

(use case is to extract data from mysql database and display).

cheers

Ben


#2

For JXA, that is possible through node-jxa, see also the JXA-Cookbook

If you are talking about OmniJS, I have no clue, but I from what I gather from https://omni-automation.com/libraries/index.html somebody deliberately chose to roll their own idea of libraries.

One can only speculate why neither JXA nor OmniJS was designed to ignore all the code available through NPM, maybe they were simply not aware of that?

I’d attempt to remedy that if there were a debugger for OmniJS available, but I’m not going to do it armed only with console.log().