Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gswalden/pkg-env

Returns an object with current NODE_ENV, package version, and several booleans about the environment
https://github.com/gswalden/pkg-env

nodejs npm-package

Last synced: 8 days ago
JSON representation

Returns an object with current NODE_ENV, package version, and several booleans about the environment

Awesome Lists containing this project

README

        

[![npm version](https://badge.fury.io/js/pkg-env.svg)](https://badge.fury.io/js/pkg-env)
[![Build status](https://travis-ci.org/gswalden/pkg-env.svg?branch=master)](https://travis-ci.org/gswalden/pkg-env)
[![Dependencies](https://david-dm.org/gswalden/pkg-env.svg)](https://david-dm.org/gswalden/pkg-env)

### Install
```sh
npm install --save pkg-env
```

### Use
```js
const pkgEnv = require('pkg-env');
console.log(pkgEnv);
/*
{
env: 'dev',
isDev: true,
isStaging: false,
isTest: false,
isProd: false,
version: '1.0.0'
}
*/

```

### Thanks
This package is a simple consolidation of two packages, [get-env](https://www.npmjs.com/package/get-env)
and [load-pkg](https://www.npmjs.com/package/load-pkg), whose authors deserve
all the credit!