processenv
Advanced tools
Comparing version 2.0.1 to 3.0.0
{ | ||
"name": "processenv", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "processenv parses environment variables.", | ||
@@ -23,10 +23,10 @@ "contributors": [ | ||
], | ||
"main": "build/lib/processEnv.js", | ||
"types": "build/lib/processEnv.d.ts", | ||
"main": "build/lib/processenv.js", | ||
"types": "build/lib/processenv.d.ts", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"assertthat": "4.0.1", | ||
"nodeenv": "2.0.0", | ||
"roboter": "7.1.5", | ||
"uuidv4": "5.0.0" | ||
"assertthat": "4.0.2", | ||
"nodeenv": "3.0.0", | ||
"roboter": "9.1.0", | ||
"uuidv4": "5.0.1" | ||
}, | ||
@@ -33,0 +33,0 @@ "repository": { |
@@ -26,3 +26,3 @@ # processenv | ||
```javascript | ||
const processenv = require('processenv').default; | ||
const { processenv } = require('processenv'); | ||
``` | ||
@@ -33,3 +33,3 @@ | ||
```typescript | ||
import processenv from 'processenv'; | ||
import { processenv } from 'processenv'; | ||
``` | ||
@@ -55,2 +55,14 @@ | ||
Alternatively, you may also provide a function which returns the default values. This is useful, e.g. if you want to lazily evaluate a value: | ||
```javascript | ||
const port = processenv('PORT', () => 3000); | ||
``` | ||
If you want to use an asynchronous function, please note that you must `await` the call to `processenv`: | ||
```javascript | ||
const port = await processenv('PORT', async () => 3000); | ||
``` | ||
#### Using the `||` operator | ||
@@ -57,0 +69,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9149
11
96
93
0
3