[![Build Status](https://travis-ci.org/kwonoj/getroot.svg?branch=master)](https://travis-ci.org/kwonoj/getroot)
[![Build status](https://ci.appveyor.com/api/projects/status/mvpjn9ob40cubbuf?svg=true)](https://ci.appveyor.com/project/kwonoj/getroot)
[![codecov](https://codecov.io/gh/kwonoj/getroot/branch/master/graph/badge.svg)](https://codecov.io/gh/kwonoj/getroot)
[![npm](https://img.shields.io/npm/v/getroot.svg)](https://www.npmjs.com/package/getroot)
[![node](https://img.shields.io/badge/node-=>4.0-blue.svg?style=flat)](https://www.npmjs.com/package/getroot)

# getroot

`getroot` is simple utility wraps access to global object.

# Install

```sh
npm install getroot
```

# Usage


```js
import { root } from 'getroot';

//root is either `window` or `global` based on running environment.
```

# Building / Testing

Few npm scripts are supported for build / test code.

- `build`: Transpiles code to ES5 commonjs to `dist`.
- `test`: Run unit test
- `lint`: Run lint over all codebases
- `lint:staged`: Run lint only for staged changes. This'll be executed automatically with precommit hook.
- `commit`: Commit wizard to write commit message

# License

[MIT](https://github.com/kwonoj/getroot/blob/master/LICENSE)