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

1.0.1 • 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;

/window-getters/

    Package Sidebar

    Install

    npm i window-getters

    Weekly Downloads

    4,795

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    115 kB

    Total Files

    13

    Last publish

    Collaborators

    • pedrouid