Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 896 Bytes

dom_global_shim_readme.md

File metadata and controls

27 lines (17 loc) · 896 Bytes

Overview

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.

TOC

Usage

/*
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)

API