@offirmo/universal-debug-api-placeholder

Implementation of Offirmo’s Universal Debug Api doing nothing at all, yielding to any other effective implementation

Usage no npm install needed!

<script type="module">
  import offirmoUniversalDebugApiPlaceholder from 'https://cdn.skypack.dev/@offirmo/universal-debug-api-placeholder';
</script>

README

Offirmo’s Universal Debug API - no op placeholder
Offirmo’s quality seal

npm badge dependencies badge bundle size badge license badge maintenance status badge

This is a minimal, no-operation implementation of Offirmo’s Universal Debug API.

Isomorphic, for node and browser.

Does nothing, minimal code footprint. BUT will transparently yield to any other previously required/imported effective version such as node or browser. Pro tip: for browser, hot-swap this placeholder at run time with the companion webextension!

See overall explanation: Offirmo’s Universal Debug API.

Usage

Use this lib to not bloat your module or webapp/lambda/npx bundle. This no-op implementation will do nothing = display nothing = compute nothing.

However, when an effective implementation is used (see above), this module will silently and automatically forward the effective implementation instead of its own no-op mock.

import {
    getLogger,
    exposeInternal,
    overrideHook,
    addDebugCommand,
    globalThis, // exposed from sub-dependency for convenience
} from '@offirmo/universal-debug-api-placeholder'