std-env 1.0.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +5 -3
  2. package/index.js +9 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -26,15 +26,17 @@ console.log(env)
26
26
  /*
27
27
  {
28
28
  test: false,
29
- dev: false,
29
+ dev: true,
30
30
  production: false,
31
+ debug: false,
31
32
  ci: false,
32
33
  tty: true,
33
- minimalCLI: false
34
+ minimalCLI: false,
35
+ windows: false
34
36
  }
35
37
  */
36
38
  ```
37
39
 
38
40
  ## License
39
41
 
40
- MIT
42
+ MIT
package/index.js CHANGED
@@ -1,14 +1,18 @@
1
1
  const isCI = require('is-ci')
2
2
 
3
+ const { DEBUG, NODE_ENV = 'development' } = process.env
4
+
3
5
  const env = {
4
- test: Boolean(process.env.NODE_ENV === 'test'),
5
- dev: Boolean(process.env.NODE_ENV === 'dev'),
6
- production: Boolean(process.env.NODE_ENV === 'production'),
6
+ test: NODE_ENV === 'test',
7
+ dev: NODE_ENV === 'development' || NODE_ENV === 'dev',
8
+ production: NODE_ENV === 'production',
9
+ debug: Boolean(DEBUG),
7
10
  ci: Boolean(isCI),
8
11
  tty: Boolean(process.stdout.isTTY),
9
- minimalCLI: undefined
12
+ minimalCLI: undefined,
13
+ windows: /^win/.test(process.platform)
10
14
  }
11
15
 
12
- env.minimalCLI = env.ci || env.test || env.producion || !env.tty
16
+ env.minimalCLI = env.ci || env.test || env.production || !env.tty
13
17
 
14
18
  module.exports = env
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "std-env",
3
- "version": "1.0.0",
3
+ "version": "1.3.1",
4
4
  "description": "Detect running environment of the current Node.js process",
5
5
  "main": "index.js",
6
6
  "scripts": {