DEV Community

Lukas Gaucas
Lukas Gaucas

Posted on

JavaScript web__constants (Node.js-friendly)

Intro

All magic based upon import.meta operator natively baked-in on ES6 modules (ESM)

Bear in mind the following:

/* --- This is also mentioned in the code ---
URL scheme depending on :
a) server (web, Node.js) => http(s)://
b) file-system (Node.js only) => file:///
*/
Enter fullscreen mode Exit fullscreen mode

Open sanbox in a dedicated tab & run the following on a shell:

node index.mjs

Top comments (0)