I am attempting to use Luxon with Postman, but I’m struggling to initiate calls via an extenal library. I continue to get the following error:
There was an error in evaluating the Pre-request Script:Error: luxon is not defined
Here’s a copy of the pre-request script I’m using to fetch the library:
if (!pm.globals.has("luxon_js")) {
pm.sendRequest("https://cdnjs.cloudflare.com/ajax/libs/luxon/3.4.4/luxon.min.js", (err, res) => {
pm.globals.set("luxon_js", res.text());
})
}
(new Function(pm.globals.get("luxon_js")))();
let DateTime = luxon.DateTime;
I was able to spin up DAYJS using a similar approach, but am now looking into Luxon as an alternative due to some time zone conversion issues I’ve uncovered using DAYJS.
It looks like this library is meant to be installed as a node.JS application, so not sure you can just include it as it does appear to have dependencies despite what the Github repository says. Intl is installed with a Node.JS application as a base library, so most wouldn’t even know its there.