Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ronniechong/browser-or-node

Check for browser or node environment
https://github.com/ronniechong/browser-or-node

Last synced: about 1 month ago
JSON representation

Check for browser or node environment

Awesome Lists containing this project

README

        

# browser-or-node
![NPM](https://img.shields.io/npm/l/@digitalronin/browser-or-node)
[![npm (scoped)](https://img.shields.io/npm/v/@digitalronin/browser-or-node)](https://npmjs.org/package/@digitalronin/browser-or-node "View this project on npm")
[![Build Status](https://travis-ci.com/ronniechong/browser-or-node.svg?branch=master)](https://travis-ci.com/ronniechong/browser-or-node)

Check for browser or node environment

## Installing

```
# using NPM
> npm install @digitalronin/browser-or-node -S

# using Yarn
> yarn add @digitalronin/browser-or-node --save
```

## Running

```javascript
const { isNode, isBrowser, getInfo } = require('browser-or-node');
console.log(isNode());
console.log(isBrowser());
console.log(getInfo());
```