Comparing version 5.0.1 to 6.0.0
(function () { | ||
var options = {} | ||
process.argv.forEach(function (val, idx, arr) { | ||
var matches = val.match(/^dotenv_config_(.+)=(.+)/) | ||
if (matches) { | ||
options[matches[1]] = matches[2] | ||
} | ||
}) | ||
require('./lib/main').config(options) | ||
require('./lib/main').config( | ||
require('./lib/cli-options')(process.argv) | ||
) | ||
})() |
@@ -1,3 +0,1 @@ | ||
'use strict' | ||
const fs = require('fs') | ||
@@ -17,3 +15,3 @@ const path = require('path') | ||
// matching "KEY' and 'VAL' in 'KEY=VAL' | ||
const keyValueArr = line.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/) | ||
const keyValueArr = line.match(/^\s*([\w.-]+)\s*=\s*(.*)?\s*$/) | ||
// matched? | ||
@@ -20,0 +18,0 @@ if (keyValueArr != null) { |
{ | ||
"name": "dotenv", | ||
"version": "5.0.1", | ||
"version": "6.0.0", | ||
"description": "Loads environment variables from .env file", | ||
@@ -8,4 +8,3 @@ "main": "lib/main.js", | ||
"pretest": "npm run lint", | ||
"test": "lab", | ||
"ci:coverage": "lab test/* -r lcov | coveralls", | ||
"test": "tap tests/*.js --100", | ||
"lint": "standard", | ||
@@ -32,14 +31,11 @@ "postlint": "npm run lint-md", | ||
"devDependencies": { | ||
"babel": "5.8.23", | ||
"coveralls": "^2.11.9", | ||
"lab": "^14.3.2", | ||
"should": "11.1.1", | ||
"sinon": "1.17.6", | ||
"standard": "8.4.0", | ||
"standard-markdown": "2.2.0" | ||
"sinon": "^5.0.2", | ||
"standard": "^11.0.1", | ||
"standard-markdown": "^4.0.2", | ||
"tap": "^11.1.4" | ||
}, | ||
"dependencies": {}, | ||
"engines": { | ||
"node": ">=4.6.0" | ||
"node": ">=6" | ||
} | ||
} |
@@ -16,3 +16,7 @@ # dotenv | ||
```bash | ||
npm install dotenv --save | ||
# with npm | ||
npm install dotenv | ||
# or with Yarn | ||
yarn add dotenv | ||
``` | ||
@@ -117,3 +121,3 @@ | ||
const dotenv = require('dotenv') | ||
const buf = new Buffer('BASIC=basic') | ||
const buf = Buffer.from('BASIC=basic') | ||
const config = dotenv.parse(buf) // will return an object | ||
@@ -214,5 +218,5 @@ console.log(typeof config, config) // object { BASIC : 'basic' } | ||
import dotenv from 'dotenv' | ||
import errorReporter from './errorReporter' | ||
dotenv.config() | ||
import errorReporter from './errorReporter' | ||
errorReporter.client.report(new Error('faq example')) | ||
@@ -219,0 +223,0 @@ ``` |
Sorry, the diff of this file is not supported yet
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
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 2 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
22672
4
13
205
262
10
1