Newton's Poleless Magnet
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    get-globalpublic

    Get global

    get-global is a simple tool for getting the global object. If it's running in the browser, it will return window, if it's running in node.js it will return GLOBAL, or whatever the global object is in the current runtime.

    It will work in 'strict mode' too.

    Installation

    npm install get-global

    How to use

    Require get-global:

    var getGlobal = require("get-global");
    var globalObject = getGlobal();
     
    globalObject === window; // in the browser 
    globalObject === GLOBAL; // in node.js 

    LICENSE

    MIT

    install

    npm i get-global

    Downloadslast 7 days

    6

    version

    0.0.1

    license

    none

    homepage

    github.com

    last publish

    collaborators

    • avatar