globals

A single JSON file of global identifiers for every JavaScript environment, used by ESLint and other static analysis tools.

Library
npm
v17.12.0
610 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
72 /100 Good
Development Activity 68
Maintenance 64
Community 76
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
68 /100 Good
Architecture 78
Code Quality 90
Innovation 65
Learning Curve 40

globals is a small, dependency-free npm package that ships one thing: a JSON map of global identifiers for dozens of JavaScript environments — browsers, Node.js, Deno, Bun, web workers, service workers, and test frameworks like Jest and Vitest. Each environment key maps to an object of global names, where the value indicates whether static-analysis tools should treat that global as writable (true) or read-only (false).

The package is best known as the data source behind ESLint’s built-in environment configs (for ESLint 8 and earlier), letting linters know that window or process are legitimate globals rather than undefined variables. Its accuracy comes from an automated pipeline: rather than hand-maintaining lists from documentation, scripts/update.mjs and a monthly scheduled GitHub Action actually launch real browsers via Puppeteer and real Deno/Bun runtimes to enumerate live globals, then regenerate globals.json and its accompanying TypeScript types from that ground truth.

What You Get

  • A globals.json data file covering 50+ environments, from browser and node to specific ECMAScript editions, test frameworks, and worker types
  • Read-only vs. writable flags on every global, so tools can distinguish overridable identifiers (like event in some browser contexts) from strictly read-only ones
  • Separate nodeBuiltin and node environments, letting consumers detect accidental CommonJS-only references in ESM code
  • Generated TypeScript type definitions (index.d.ts) verified with tsd, giving typed, autocompletable access to every environment object
  • A reproducible update pipeline (scripts/update.mjs) that regenerates the data by querying real browser, Deno, and Bun runtimes rather than transcribing documentation by hand

Common Use Cases

  • Populating a linter’s or custom static-analysis tool’s list of predefined globals for a given runtime
  • Detecting undeclared-variable false positives in codebases that mix multiple JavaScript environments
  • Auditing whether code relies on CommonJS-only globals (require, module) inside a project meant to run as pure ESM
  • Feeding bundler or transform tooling a canonical list of identifiers that should not be treated as free variables to resolve or polyfill

Under The Hood

Architecture The package cleanly separates build-time data generation from runtime consumption. Sixty-odd source modules under data/ (browser.mjs, node.mjs, jest.mjs, es2015.mjs through es2024.mjs, and more) each describe one environment’s globals; scripts/generate-data.mjs reads every file in data/, assembles them into a single globals.json, and scripts/generate-types.mjs derives index.d.ts from that same aggregate. The published package itself is deliberately minimal — index.js is a one-line re-export of the JSON file — so the real architectural surface lives in the scripts and data directories that produce it, and changing the shape of a per-environment entry means updating both the data-generation and type-generation scripts in lockstep, plus every downstream linter config that dereferences a specific environment key.

Tech Stack Everything runs on plain Node.js ESM scripts with zero runtime dependencies for the published package; devDependencies carry the real machinery — Puppeteer to launch actual browsers and scrape live window globals, nano-spawn to shell out to Deno and Bun for their builtin globals, Cheerio for parsing reference HTML, ava for tests, xo (ESLint-based) for linting, tsd with type-fest for type testing, and npm-run-all2 to sequence the build:data and build:types steps. The deployment target is simply the npm registry, publishing index.js, index.d.ts, and globals.json as static files.

Code Quality Testing goes beyond static assertions: test.mjs (run via ava) launches real browser, Deno, Bun, Jest, and Vitest environments and diffs the package’s data against what those runtimes actually expose, catching drift that a hand-maintained list would miss. Type correctness is checked with tsd against index.test-d.ts. CI (main.yml) runs the full test suite across Node 18 and 20 on every push and PR, and a separate scheduled update.yml workflow does a dry-run of the update script monthly across Ubuntu, macOS, and Windows to catch platform-specific drift before it reaches a release. Linting is enforced via xo, which is itself an ESLint config, giving the project a dogfooding relationship with the exact static-analysis ecosystem it serves.

What Makes It Unique Most lists of environment globals are hand-transcribed from documentation and go stale as runtimes evolve. This package’s distinguishing choice is verification by execution: its update pipeline doesn’t trust written docs, it spins up the actual browser/Deno/Bun/test-framework environments and reads their real global scope, then regenerates the data from that ground truth on a recurring schedule. That turns a seemingly static reference file into a continuously self-correcting one.

Used by 125 apps in this directory

JavaScript
60%
Apache 2.0

peerd

AI Agents

415

The first AI agent harness native to the browser — a Chrome/Firefox extension that drives your tabs, spins up sandboxed compute (JS notebooks, WASM Linux VMs), and shares what it builds peer-to-peer, with no backend, no telemetry, and BYOK.

View details
78
Repo Health
70
Technical
0
Dependency
Built with
JavaScript 60%
TypeScript 38%
Updated 1 weeks ago
Clojure
72%
MPL 2.0

Penpot

Design Tools

60,454

Open-source design platform with GPU-accelerated canvas, native design tokens, and MCP-powered AI workflows for teams that ship fast.

View details
91
Repo Health
83
Technical
73
Dependency
Built with
Clojure 72%
Updated 1 weeks ago
Python
49%
Other

Arize Phoenix

Analytics · Devops · Monitoring

11,641

Open-source AI observability platform for tracing, evaluating, and debugging LLM applications with built-in intelligence and MCP support.

View details
90
Repo Health
88
Technical
67
Dependency
Built with
Python 49%
TypeScript 42%
Updated 1 weeks ago
TypeScript
89%
MIT

Plasmic

CMS · Design Tools · Low Code Platforms

7,048

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
Elixir
80%
AGPL 3.0

Plausible Analytics

Analytics

29,237

Open-source, cookie-free web analytics that respects visitor privacy and replaces Google Analytics.

View details
88
Repo Health
84
Technical
71
Dependency
Built with
Elixir 80%
TypeScript 14%
Updated 1 weeks ago
Python
65%
Apache 2.0

Polar

Developer Tools · Ecommerce · Invoicing Finance

10,293

Open source payments infrastructure that turns software into a business — subscriptions, usage-based billing, digital products, and merchant-of-record compliance in one platform.

View details
90
Repo Health
82
Technical
66
Dependency
Built with
Python 65%
TypeScript 28%
Updated 1 weeks ago
TypeScript
51%
ZLIB

Portainer

Devops

38,590

A lightweight, open-source web UI that puts Docker, Kubernetes, and Podman management within reach of any team—no CLI expertise required.

View details
92
Repo Health
79
Technical
65
Dependency
Built with
TypeScript 51%
Go 38%
Updated 2 weeks ago
TypeScript
60%
AGPL 3.0

Puter

Developer Tools · File Storage

43,605

A self-hostable, web-based internet OS with desktop GUI, cloud storage, AI drivers, and a developer SDK — all running in your browser.

View details
88
Repo Health
88
Technical
70
Dependency
Built with
TypeScript 60%
JavaScript 36%
Updated 1 weeks ago
Go
90%
AGPL 3.0

Pyroscope

Developer Tools · Devops · Monitoring

11,678

An open-source, horizontally scalable continuous profiling platform that pinpoints CPU, memory, and I/O bottlenecks down to the exact line of code, built by Grafana Labs alongside Loki, Tempo, and Mimir.

View details
91
Repo Health
89
Technical
65
Dependency
Built with
Go 90%
Updated 2 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers