Global identifiers from different JavaScript environments
JavaScript Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore Meta tweaks Nov 17, 2017
.npmrc
.travis.yml Meta tweaks Jun 19, 2018
Makefile Add Makefile for standardized releases Dec 10, 2014
get-browser-globals.js Make event properties rewritable (#124) Nov 17, 2017
globals.json
index.js Require Node.js 4 Jun 7, 2017
license Require Node.js 4 Jun 7, 2017
package.json 11.7.0 Jun 20, 2018
readme.md
test.js Enforce correct alphabetical order Dec 9, 2017

readme.md

globals Build Status

Global identifiers from different JavaScript environments

Extracted from JSHint and ESLint and merged.

It's just a JSON file, so use it in whatever environment you like.

This module no longer accepts new environments. If you need it for ESLint, just create a plugin.

Install

$ npm install globals

Usage

const globals = require('globals');

console.log(globals.browser);
/*
{
	addEventListener: false,
	applicationCache: false,
	ArrayBuffer: false,
	atob: false,
	...
}
*/

Each global is given a value of true or false. A value of true indicates that the variable may be overwritten. A value of false indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be false unless we hear otherwise.

License

MIT © Sindre Sorhus