@haensl/environments
v1.0.2
Published
Simple JSON object of runtime environments.
Downloads
35
Maintainers
Readme
@haensl/environments
JS runtime environments. Simple JSON object.
Installation
Via npm
$ npm install -S @haensl/environments
Via yarn
$ yarn add @haensl/environments
Usage
Use environments in your projects:
ESM, i.e.
import
import environments from '@haensl/environments'; // Spreading the import works, too. // import { production } from '@haensl/environments'; // ... if (currentEnvironment === environments.production) { // do stuff on production only }
CJS, i.e.
require
const environments = require('@haensl/environments'); // ... if (currentEnvironment === environments.production) { // do stuff on production only }
Synopsis
The environments
object is a simple JSON object that maps to strings:
{
"development": "development",
"production": "production",
"qa": "qa",
"test": "test"
}