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

1.0.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 @doneup/window-getters

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

69.6 kB

Total Files

13

Last publish

Collaborators

  • gregb-du