@nitra/isenv
Version:
NODE_ENV shortcuts
66 lines (43 loc) • 1.1 kB
Markdown
[](https://codeclimate.com/github/nitra/isenv/maintainability)
```bash
$ npm install @nitra/isenv --save
```
or
```bash
$ yarn add @nitra/isenv
```
```javascript
"use strict";
import { isDev, isProd } from "@nitra/isenv";
{
console.log("is production =", isProd);
/* ... */
if (isDev) {
/* ... */
}
}
```
```javascript
"use strict";
const { isDev, isProd } = reuire("@nitra/isenv");
{
console.log("is production =", isProd);
/* ... */
if (isDev) {
/* ... */
}
}
```
Available vars
| Signature | Description |
| ------------------- | ------------------------------ |
| `isDev -> boolean` | True if the env it development |
| `isProd -> boolean` | True if the env is production |
| `isTest -> boolean` | True if the env is test |
This software is released under the [MIT License](https://github.com/nitra/isenv/blob/master/LICENSE).