Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marcoworms/am-i-in-browser

A function do determine whether your script is running on node or browser environment.
https://github.com/marcoworms/am-i-in-browser

Last synced: about 1 month ago
JSON representation

A function do determine whether your script is running on node or browser environment.

Awesome Lists containing this project

README

        

`npm install am-i-in-browser --save`

```javascript
const isBrowser = require('am-i-in-browser')

if (isBrowser()) {
console.log('you are running this in a browser!')
} else {
console.log('you are running this in node!')
}
```