$ npm install @putout/plugin-apply-global-this
Historically, accessing the global object has required different syntax in different JavaScript environments. On the web you can use
window,self, or frames - but in Web Workers onlyselfwill work. In Node.js none of these work, and you must instead useglobal(c) MDN
πPutout plugin adds ability to find and apply globalThis.
Check out in πPutout Editor.
npm i @putout/plugin-apply-global-this
{
"rules": {
"apply-global-this": "on"
}
}
globalThis.__putout_debug = debugFn;
globalThis.CloudCmd = {};
globalThis.__putout_debug = debugFn;
globalThis.CloudCmd = {};
| Linter | Rule | Fix |
|---|---|---|
| π Putout | apply-global-this |
β |
| β£ ESLint | no-node-globals |
β |
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE