Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@alwatr/global-this
Advanced tools
Provides access to `globalThis`, ensuring cross-platform compatibility, including browsers (`window`), Node.js (`global`), and Web Workers (`self`).
Provides access to globalThis
, ensuring cross-platform compatibility, including browsers (window
), Node.js (global
), and Web Workers (self
).
yarn add @alwatr/global-this
import {getGlobalThis} from '@alwatr/global-this';
getGlobalThis<{alwatr: {foo: string}}>().alwatr = {
foo: 'bar',
};
import {getGlobalThis} from '@alwatr/global-this';
getGlobalThis().setTimeout(() => {
console.log(getGlobalThis<{alwatr: {foo: string}}>().alwatr.foo); // 'bar'
}, 1_000);
The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
Contributions are welcome! Please read our contribution guidelines before submitting a pull request.
This project is licensed under the AGPL-3.0 License.
FAQs
Provides access to `globalThis`, ensuring cross-platform compatibility, including browsers (`window`), Node.js (`global`), and Web Workers (`self`).
We found that @alwatr/global-this demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.