global-var
Version:
Get the correct 'global' variable for the current runtime environment (`window` in browser, `global` in node, etc)
51 lines (32 loc) • 1.24 kB
Markdown
# global-var   
> Get the correct 'global' variable for the current runtime environment (`window` in browser, `global` in node, etc)
## Install
Install with [npm](https://www.npmjs.com/)
```sh
$ npm i global-var --save
```
## Usage
```js
var globals = require('global-var');
globals.setTimeout(
function(){
console.log('Hello, world!');
}, 1000);
// --> "Hello, world!" after 1000ms
```
## Running tests
Install dev dependencies:
```sh
$ npm i -d && npm test
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/AndreasPizsa/global-var/issues/new).
## Author
**Andreas Pizsa**
+ [github/AndreasPizsa](https://github.com/AndreasPizsa)
+ [twitter/AndreasPizsa](http://twitter.com/AndreasPizsa)
## License
Copyright © 2016 Andreas Pizsa
Released under the MIT license.
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on February 16, 2016._