dom_global_shim.mjs re-exports global
from dom_shim
. It's a counterpart to dom_global_native
. When writing code to run in both non-DOM and DOM environments, configure your bundler or importmap to import dom_global_shim
in non-browsers, and dom_global_native
in browsers.
In code intended only for non-browser environments, simply import dom_global_shim
instead.
/*
Use a bundler or importmap to alias this import to one of:
https://cdn.jsdelivr.net/npm/@mitranim/[email protected]/dom_global_native.mjs
https://cdn.jsdelivr.net/npm/@mitranim/[email protected]/dom_global_shim.mjs
*/
import * as dg from 'dom_global'
console.log(dg.global)