ienv

Is Env - Environment Detecter

  • ienv

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
ienv
2.0.04 years ago5 years agoMinified + gzip package size for ienv in KB

Readme

<img src="https://flat.badgen.net/github/release/rwu823/ienv" />
<img src="https://flat.badgen.net/npm/v/ienv" />
<img src="https://flat.badgen.net/circleci/github/rwu823/ienv/master" />
<img src="https://flat.badgen.net/codecov/c/github/rwu823/ienv" />

Installation

$ yarn add ienv

Usage

import env, { isNode, isDev } from 'ienv'

Exports CONSTANTS

env: string

Get process.NODE_ENV default is development

isDev: boolean

process.NODE_ENV === 'development'

isProd: boolean

process.NODE_ENV === 'production'

isBrowser: boolean

Check if in browser

isNode: boolean

Check if in Node

Global

Returns window in browser, global in Node.