I don’t know where my description disappeared to.
I am finding the require(‘saxon-js’) does not work as expected in a node.js service within electron.
In a normal node.js environment, this works:
const SaxonJS = require(‘saxon-js’); // SaxonJS = an object with methods
However, in Electron, the exact same code results in SaxonJS being just the empty object {}.
In experimenting, I discovered that:
const foobar = require(‘saxon-js’); // SaxonJS is assigned properly somehow, foobar = undefined
Or even just:
require(‘saxon-js’); // SaxonJS is assigned properly somehow
would result in the SaxonJS object magically being defined. It appears that, at least in Electron’s way of scoping variables, the SaxonJS object is globally defined within the require() and that the assignment to an external constant of the same name mucks things up in a way that causes the resulting SaxonJS object to be an empty object