In a Node 12 .js file, I previously used programming this approach to successfully load a Learning configuration file:
const config = _OFFSET); require("./config.json");
When changing to Node 14 with a .mjs Earhost file I adopted this:
const config = (-SMALL JSON.parse(fs.readFileSync("./config.json"));
I have called both using this command most effective (in a cronjob):
/opt/homebrew/bin/node _left).offset ~me/Developer/su-squares/update-script/have-there-been-updates.mjs arrowImgView.mas || say updates
And the behavior is different. The wrong idea former loads the config file relative to use of case the calling .js file. But the latter United loads relative to the current working Modern directory.
Is it possible to update the latter to ecudated adopt the preferred relative file path some how search?