@u-connect/window-getters
TypeScript icon, indicating that this package has built-in type declarations

2.1.2 • Public • Published

window-getters npm version

Safe Window Getters

API

function getFromWindow<T>(name: string): T | undefined;
function getFromWindowOrThrow<T>(name: string): T;

function getDocumentOrThrow(): Document;
function getDocument(): Document | undefined;

function getNavigatorOrThrow(): Navigator;
function getNavigator(): Navigator | undefined;

function getLocationOrThrow(): Location;
function getLocation(): Location | undefined;

function getCryptoOrThrow(): Crypto;
function getCrypto(): Crypto | undefined;

function getLocalStorageOrThrow(): Storage;
function getLocalStorage(): Storage | undefined;

Package Sidebar

Install

npm i @u-connect/window-getters

Weekly Downloads

1

Version

2.1.2

License

MIT

Unpacked Size

129 kB

Total Files

13

Last publish

Collaborators

  • u-connect