New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-is-dev

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-is-dev

A simple library to determine whether a react app is under development or production environment

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
9
-25%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Coverage Status

Description

The library provides a single function to determine the environment under which a react app is started. The function returns true in case of react development server, false in case of built application.

Tested with create-react-app.

Installation

npm i react-is-dev

Import

import isDev from 'react-is-dev';

Usage

isDev is a simple function returning Boolean value and accepting your React instance as a parameter.

So, to determine whether your app is under development or production enviroment, use:

import React from 'react';
...
import isDev from 'react-is-dev';
...
...
const ifDevEnv = isDev(React); // true if development mode, false if production

Keywords

react

FAQs

Package last updated on 28 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts