<commit_before>window-or-global
================

Use this module to get the global object both on server and client side.
No more `window is not defined` errors just peace and flowers.

Advantages:

- You can easily mock it by [mockery](https://www.npmjs.com/package/mockery) or [proxyquire](https://www.npmjs.com/package/proxyquire) in your tests
- It's really useful in case of universal (or isomorphic) code, for example, when you'd like to render a [React](http://facebook.github.io/react/) component both on client and server side

## Install

```sh
$ npm i window-or-global
```

## Usage

```js
import root from 'window-or-global'
```

## React example<commit_msg>add the source of the code<commit_after>window-or-global
================

Use this module to get the global object both on server and client side.
No more `window is not defined` errors just peace and flowers.

The code is borrowed from [megawac/underscore@365311c](https://github.com/megawac/underscore/commit/365311c9a440438531ca1c6bfd49e3c7c5f46079). 

Advantages:

- You can easily mock it by [mockery](https://www.npmjs.com/package/mockery) or [proxyquire](https://www.npmjs.com/package/proxyquire) in your tests
- It's really useful in case of universal (or isomorphic) code, for example, when you'd like to render a [React](http://facebook.github.io/react/) component both on client and server side

## Install

```sh
$ npm i window-or-global
```

## Usage

```js
import root from 'window-or-global'
```

## React example
{'fraction_non_alphanumeric': 0.13266666666666665, 'fraction_numerical': 0.02266666666666667, 'mean_word_length': 4.621722846441948, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2416701', 'n_tokens_mistral': 497, 'n_tokens_neox': 451, 'n_words': 166}