# isdev

> Returns a boolean indicating if you are in a development environment or not

Latest version **1.0.1** (published 2014-11-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install isdev
pnpm add isdev
yarn add isdev
bun add isdev
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2014-11-01 |
| First published | 2014-11-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | william.jblakenship |
| Maintainers | wblankenship |
| Keywords | development, environment, dev, isdev |

## Links

- npm: https://www.npmjs.com/package/isdev
- Repository: https://github.com/wblankenship/isDev
- Issues: https://github.com/wblankenship/isDev/issues
- npm.io page: https://npm.io/package/isdev

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2014-11-01
- 1.0.0 — 2014-11-01

## README

isDev
===

A simple little utility for checking if you are in a development environment.

The speicification can be found in the mocha tests, but gist is this:

*NODE_ENV value:*
* Development environment:
  * `'dev'`
  * `'development'`
  * `undefined`
* Not Development
  * everything else


To use:

```
var isDev = require('isDev')

if(isDev) {
  console.log("In Development!")
} else {
  console.log("Not in Development!")
}
```

On the off chance that you change your NODE_ENV mid-execution (*READ*: DO _NOT_ DO THIS!), you need to clear the require cache for isDev since we cache the result:

```
process.env.NODE_ENV = 'dev'
var isDev = require('isDev')
process.env.NODE_ENV = 'production'
//isDev still thinks we are in dev here.
delete require.cache[require.resolve('isDev')]
isDev = require('isDev')
//isDev no longer thinks we are in dev
```

---
_Source: https://npm.io/package/isdev · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
