Socket
Book a DemoInstallSign in
Socket

get-global

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-global

get the global object, independently of the JS runtime

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

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

Keywords

global

FAQs

Package last updated on 30 Mar 2014

Did you know?

Socket

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.

Install

Related posts