1.0.2 • Published 2 months ago
@haensl/environments v1.0.2
@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`
```javascript
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`
```javascript
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"
}