# @pakal/get-global

> Get Global is package from Pakal library

Latest version **0.2.1** (published 2019-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pakal/get-global
pnpm add @pakal/get-global
yarn add @pakal/get-global
bun add @pakal/get-global
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2019-04-15 |
| First published | 2019-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 27.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Yisrael Eliev |
| Maintainers | yisraelx |
| Keywords | utils, utilities, modules, modular |

## Links

- npm: https://www.npmjs.com/package/@pakal/get-global
- Repository: https://github.com/yisraelx/pakal
- Homepage: https://github.com/yisraelx/pakal#readme
- Issues: https://github.com/yisraelx/pakal/issues
- npm.io page: https://npm.io/package/@pakal/get-global

## Recent versions

- 0.2.1 (latest) — 2019-04-15
- 0.2.0 — 2019-03-31

## README

# @pakal/get-global
[![Source Code](https://img.shields.io/badge/%3C%2F%3E-source_code-blue.svg)](https://github.com/yisraelx/pakal/blob/master/modules/get-global)
[![Version](https://img.shields.io/npm/v/@pakal/get-global.svg)](https://www.npmjs.com/package/@pakal/get-global)
[![MIT License](https://img.shields.io/npm/l/@pakal/get-global.svg?color=yellow)](https://github.com/yisraelx/pakal/blob/master/LICENSE)
[![Bundle Size](https://img.shields.io/bundlephobia/min/@pakal/get-global.svg?color=green)](https://bundlephobia.com/result?p=@pakal/get-global)
[![TypeScript](https://img.shields.io/badge/100%25-TypeScript-blue.svg)](https://www.typescriptlang.org)

**Get Global is package from Pakal library**

## Install
```sh
$ yarn add @pakal/get-global
```
Or
```sh
$ npm install --save @pakal/get-global
```

## Use
**Module**
```typescript
import {
  default as getGlobal
} from '@pakal/get-global';
```

**Browser**
```html
<script src="https://unpkg.com/@pakal/get-global/bundle.umd.min.js"></script>
```
```typescript
let {
  getGlobal
} = _;
```

**Examples**
```typescript
 // browser
 getGlobal() === window; // => true
 // worker
 getGlobal() === self; // => true
 // nodejs
 getGlobal() === global; // => true

 getGlobal('Object') === Object; // => true
 getGlobal('NaN'); // => NaN
 getGlobal('String.prototype') === String.prototype; // => true
 getGlobal('Math.foo', 'bar'); // => 'bar'
 getGlobal('Math.zero', 0, true); // => 0
 getGlobal('Math').zero; // => 0
```
```typescript
 getGlobal('color'); // => undefined
 typeof color; // => undefined
 getGlobal('color', 'green'); // => 'green'
 typeof color; // => undefined
 getGlobal('color', 'blue', true); // => 'blue'
 color === 'blue'; // => true
 getGlobal('color', 'red', true); // => 'blue'
 color === 'blue'; // => true
 color = 'yellow';
 getGlobal('color', 'black', true); // => 'yellow'
```
```typescript
 getGlobal('data'); // => undefined
 getGlobal('data', {name: 'bob'}).name; // => 'bob'
 getGlobal('data'); // => undefined
 getGlobal('data.name', 'david', true); // => 'david'
 getGlobal('data'); // => 'undefined'
 getGlobal('data', {name: 'alice'}, true).name; // => 'alice'
 getGlobal('data.name'); // => 'alice'
 getGlobal('data.name', 'john', true).name; // => 'alice'
 getGlobal('data').name; // => 'alice'
 getGlobal('data').name = 'moshe';
 getGlobal('data.name', 'steve', true); // => 'moshe'
```


## License
Copyright © [Yisrael Eliev](https://github.com/yisraelx),
Licensed under the [MIT license](https://github.com/yisraelx/pakal/blob/master/LICENSE).

---
_Source: https://npm.io/package/@pakal/get-global · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
