Comparing version
@@ -14,2 +14,3 @@ 'use strict' | ||
var encoding = 'utf8' | ||
var silent = false | ||
@@ -23,2 +24,5 @@ if (options) { | ||
} | ||
if (options.silent) { | ||
silent = options.silent | ||
} | ||
} | ||
@@ -36,3 +40,5 @@ | ||
} catch(e) { | ||
console.error(e) | ||
if (!silent) { | ||
console.error(e) | ||
} | ||
return false | ||
@@ -39,0 +45,0 @@ } |
{ | ||
"name": "dotenv", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Loads environment variables from .env file", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -7,4 +7,5 @@ # dotenv | ||
[](https://travis-ci.org/motdotla/dotenv) | ||
[](http://badge.fury.io/js/dotenv) | ||
[](https://travis-ci.org/motdotla/dotenv) | ||
[](https://www.npmjs.com/package/dotenv) | ||
[](https://github.com/feross/standard) | ||
@@ -11,0 +12,0 @@ > "Storing [configuration in the environment](http://www.12factor.net/config) |
@@ -86,2 +86,11 @@ 'use strict' | ||
it('takes option for silencing errors', function (done) { | ||
var errorStub = s.stub(console, 'error') | ||
readFileSyncStub.throws() | ||
dotenv.config({silent: true}).should.eql(false) | ||
errorStub.called.should.be.false | ||
done() | ||
}) | ||
}) | ||
@@ -88,0 +97,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
20008
2.9%236
5.83%174
0.58%0
-100%3
200%