Registry / serialization / globals-docs

globals-docs

JSON →
library2.4.1jsnpmunverified

This package provides a programmatic way to access documentation URLs for JavaScript global objects across various environments including built-in types, non-standard APIs, and browser, worker, or Node.js specific globals. It exposes a `docs` object containing all categorized links and a `getDoc` function to retrieve a specific URL by name. The current stable version is 2.4.1, which was last published over seven years ago (as of April 2026). Crucially, the GitHub repository for this project has been archived, indicating that the package is no longer maintained and is considered abandoned. Users should be aware that the documentation links provided by this package are highly likely to be outdated and may no longer resolve correctly due to changes on the target documentation sites (e.g., MDN/Mozilla Developer Center).

npm install globals-docs
INSTALL
IMPORT
SIG · GLOBALS-DOCS
G
globals-docs
serializationjavascriptv2.4.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

getDoc
const { getDoc } = require('globals-docs');
import { getDoc } from 'globals-docs';
This package is CommonJS-only (`'type': 'commonjs'` in package.json). Direct ESM `import` syntax will fail without transpilation or a bundler configured for CJS interoperability.
docs
const { docs } = require('globals-docs');
import { docs } from 'globals-docs';
The `docs` object contains all categorized documentation links, available via CommonJS `require`.
default (entire module)
const globalsDocs = require('globals-docs'); // globalsDocs.getDoc(...) // globalsDocs.docs
import globalsDocs from 'globals-docs';
The main CommonJS export is an object containing both `getDoc` and `docs` properties.

This quickstart demonstrates how to use `getDoc` to retrieve specific global documentation URLs and how to access the raw `docs` object to explore available documentation categories and links. It highlights CommonJS usage.

const { getDoc, docs } = require('globals-docs'); // Get documentation URL for a specific global const arrayDocUrl = getDoc('Array'); console.log(`Documentation URL for Array: ${arrayDocUrl}`); const promiseDocUrl = getDoc('Promise'); console.log(`Documentation URL for Promise: ${promiseDocUrl}`); // Access the full documentation object console.log('\nAvailable environments in docs object:', Object.keys(docs)); // Example: Get a link from the 'browser' environment if (docs.browser && docs.browser.fetch) { console.log(`Browser 'fetch' API documentation: ${docs.browser.fetch}`); } // Try a global that might not exist or be commonly documented by this package's age const nonExistentDoc = getDoc('NonExistentGlobalABCDEF'); console.log(`Documentation for NonExistentGlobalABCDEF: ${nonExistentDoc ? nonExistentDoc : 'Not found (expected)'}`);
Debug
Known issues
breakingThe project's GitHub repository has been archived, indicating it is no longer actively maintained. This means no new features, bug fixes, or security updates will be released.
fix
Consider alternatives that provide up-to-date documentation links or directly reference current MDN/developer resources.
affects: >=2.4.1
gotchaDocumentation links provided by this package are highly likely to be outdated. The last release was over seven years ago, and target documentation sites (like MDN) frequently update their URL structures and content.
fix
Always verify retrieved URLs manually before relying on them. For current documentation, prefer direct searches on MDN Web Docs or other official sources.
affects: >=2.4.1
gotchaThe package does not support ECMAScript Modules (ESM) directly. Attempting to use `import ... from 'globals-docs'` will result in a runtime error unless your build setup (e.g., Webpack, Rollup, Babel) is configured to transpile or resolve CommonJS modules.
fix
Use CommonJS `const { symbol } = require('globals-docs');` syntax. If you absolutely need ESM, ensure your bundler properly handles CJS interoperability.
affects: >=2.0.0
gotchaThis package will not include documentation for newer JavaScript features, APIs (e.g., `globalThis`, many new Array methods), or browser/Node.js globals introduced after its last update in early 2019.
fix
For modern JavaScript features, rely on contemporary documentation sources. This package is only useful for historically stable, older APIs.
affects: >=2.4.1
Errors
Common errors & fixes
TypeError: Cannot destructure property 'getDoc' of 'require(...)' as it is undefined.
Attempting to use ESM `import` syntax for a CommonJS-only package without proper tooling, or trying to access a non-existent export.
fix
Ensure you are using CommonJS `const { getDoc } = require('globals-docs');`. If the symbol itself is truly missing, check the package's exports.
Error [ERR_REQUIRE_ESM]: require() of ES Module ... is not supported.
This error usually implies the reverse: you're trying to `require()` an ESM-only package. However, in the context of `globals-docs`, this specific error is unlikely to appear from the package itself, but rather if your *own* project is ESM and trying to `require` a CJS module in a way your runtime doesn't implicitly support (e.g., `node --experimental-modules` might handle it, but pure ESM environments might not without specific loader configurations).
fix
While `globals-docs` is CJS, if you encounter this, it points to a broader module interoperability issue in your project. Ensure your Node.js version and project configuration support CJS `require` calls from your ESM code, or stick to CJS for projects using `globals-docs`.
Documentation URL for Array: undefined
The `getDoc` function returned `undefined`, meaning it couldn't find a documentation link for the requested global name in its internal data.
fix
Verify the spelling of the global object name. Be aware that the package is outdated and may not contain links for all existing or newly introduced globals.
Upgrade
Version history
2.4.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
globals-docs — npm install globals-docs · libregistry