{"id":16041,"library":"globals-docs","title":"JavaScript Global Documentation Links","description":"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).","status":"abandoned","version":"2.4.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/documentationjs/globals-docs","tags":["javascript","documentation","links","mdc","mozilla","developer","center","node"],"install":[{"cmd":"npm install globals-docs","lang":"bash","label":"npm"},{"cmd":"yarn add globals-docs","lang":"bash","label":"yarn"},{"cmd":"pnpm add globals-docs","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"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.","wrong":"import { getDoc } from 'globals-docs';","symbol":"getDoc","correct":"const { getDoc } = require('globals-docs');"},{"note":"The `docs` object contains all categorized documentation links, available via CommonJS `require`.","wrong":"import { docs } from 'globals-docs';","symbol":"docs","correct":"const { docs } = require('globals-docs');"},{"note":"The main CommonJS export is an object containing both `getDoc` and `docs` properties.","wrong":"import globalsDocs from 'globals-docs';","symbol":"default (entire module)","correct":"const globalsDocs = require('globals-docs');\n// globalsDocs.getDoc(...)\n// globalsDocs.docs"}],"quickstart":{"code":"const { getDoc, docs } = require('globals-docs');\n\n// Get documentation URL for a specific global\nconst arrayDocUrl = getDoc('Array');\nconsole.log(`Documentation URL for Array: ${arrayDocUrl}`);\n\nconst promiseDocUrl = getDoc('Promise');\nconsole.log(`Documentation URL for Promise: ${promiseDocUrl}`);\n\n// Access the full documentation object\nconsole.log('\\nAvailable environments in docs object:', Object.keys(docs));\n\n// Example: Get a link from the 'browser' environment\nif (docs.browser && docs.browser.fetch) {\n  console.log(`Browser 'fetch' API documentation: ${docs.browser.fetch}`);\n}\n\n// Try a global that might not exist or be commonly documented by this package's age\nconst nonExistentDoc = getDoc('NonExistentGlobalABCDEF');\nconsole.log(`Documentation for NonExistentGlobalABCDEF: ${nonExistentDoc ? nonExistentDoc : 'Not found (expected)'}`);","lang":"javascript","description":"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."},"warnings":[{"fix":"Consider alternatives that provide up-to-date documentation links or directly reference current MDN/developer resources.","message":"The 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.","severity":"breaking","affected_versions":">=2.4.1"},{"fix":"Always verify retrieved URLs manually before relying on them. For current documentation, prefer direct searches on MDN Web Docs or other official sources.","message":"Documentation 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.","severity":"gotcha","affected_versions":">=2.4.1"},{"fix":"Use CommonJS `const { symbol } = require('globals-docs');` syntax. If you absolutely need ESM, ensure your bundler properly handles CJS interoperability.","message":"The 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.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"For modern JavaScript features, rely on contemporary documentation sources. This package is only useful for historically stable, older APIs.","message":"This 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.","severity":"gotcha","affected_versions":">=2.4.1"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Ensure you are using CommonJS `const { getDoc } = require('globals-docs');`. If the symbol itself is truly missing, check the package's exports.","cause":"Attempting to use ESM `import` syntax for a CommonJS-only package without proper tooling, or trying to access a non-existent export.","error":"TypeError: Cannot destructure property 'getDoc' of 'require(...)' as it is undefined."},{"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`.","cause":"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).","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module ... is not supported."},{"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.","cause":"The `getDoc` function returned `undefined`, meaning it couldn't find a documentation link for the requested global name in its internal data.","error":"Documentation URL for Array: undefined"}],"ecosystem":"npm"}