You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,9 @@
2
2
3
3
> Global identifiers from different JavaScript environments
4
4
5
-
It's just a [JSON file](globals.json), so use it in any environment.
5
+
It's just a [JSON file](globals.json), so you can use it in any environment.
6
6
7
-
This package is used by ESLint.
8
-
9
-
**This package [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).**
7
+
This package is used by ESLint 8 and earlier. For ESLint 9 and later, you should depend on this package directly in [your ESLint config](https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables).
10
8
11
9
## Install
12
10
@@ -17,7 +15,7 @@ npm install globals
17
15
## Usage
18
16
19
17
```js
20
-
constglobals=require('globals');
18
+
importglobalsfrom'globals';
21
19
22
20
console.log(globals.browser);
23
21
/*
@@ -36,7 +34,7 @@ Each global is given a value of `true` or `false`. A value of `true` indicates t
36
34
For Node.js this package provides two sets of globals:
37
35
38
36
-`globals.nodeBuiltin`: Globals available to all code running in Node.js.
39
-
These will usually be available as properties on the `global` object and include `process`, `Buffer`, but not CommonJS arguments like `require`.
37
+
These will usually be available as properties on the `globalThis` object and include `process`, `Buffer`, but not CommonJS arguments like `require`.
40
38
See: https://nodejs.org/api/globals.html
41
39
-`globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope").
0 commit comments