@bemoje/is-node

Browser-safely returns whether the current process is a node-js process.

Usage no npm install needed!

<script type="module">
  import bemojeIsNode from 'https://cdn.skypack.dev/@bemoje/is-node';
</script>

README

@bemoje/is-node

Browser-safely returns whether the current process is a node-js process.

Version

NPM version

Travis CI

dependencies

Dependencies

dependencies

Stats

NPM downloads Forks

Donate

Buy Me A Beer donate button PayPal donate button

Installation

npm install @bemoje/is-node
npm install --save @bemoje/is-node
npm install --save-dev @bemoje/is-node

Usage

import isNode from '@bemoje/is-node'

/**
 * USE IN NODE ENVIRONMENT
 */
isNode()
//=> true

/**
 * SAFELY USE IN BROWSER ENVIRONMENT
 */
isNode()
//=> false

Tests

Uses Jest to test module functionality. Run tests to get coverage details.

npm run test

API

isNode

Browser-safely returns whether the current process is a node-js process.

Returns

boolean