JavaScript Global Documentation Links

2.4.1 · abandoned · verified Tue Apr 21

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).

Common errors

Warnings

Install

Imports

Quickstart

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)'}`);

view raw JSON →