Comparing version 0.0.2 to 0.0.3
@@ -27,2 +27,7 @@ "use strict"; | ||
var value = key_value_array[1].trim(); | ||
if (value.charAt(0) === '"' && value.charAt(value.length-1) == '"') { | ||
value = value.replace(/\\n/gm, "\n"); | ||
} | ||
value = value.replace(/['"]/gm, ''); | ||
@@ -29,0 +34,0 @@ |
{ | ||
"name": "dotenv", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Loads environment variables from .env", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -10,3 +10,3 @@ # dotenv | ||
```javascript | ||
var dotenv = require('dotenv'); | ||
var dotenv = require('dotenv')(); | ||
dotenv.load(); | ||
@@ -47,4 +47,5 @@ ``` | ||
```bash | ||
npm install | ||
npm test | ||
``` | ||
@@ -13,3 +13,3 @@ var assert = require('assert'), | ||
it('version should be set', function() { | ||
result.version.should.eql("0.0.2"); | ||
result.version.should.eql("0.0.3"); | ||
}); | ||
@@ -32,3 +32,8 @@ | ||
}); | ||
it('expands newlines but only if double quoted', function() { | ||
process.env.EXPAND_NEWLINES.should.eql("expand\nnewlines"); | ||
process.env.DONT_EXPAND_NEWLINES_1.should.eql("dontexpand\\nnewlines"); | ||
process.env.DONT_EXPAND_NEWLINES_2.should.eql("dontexpand\\nnewlines"); | ||
}); | ||
}); | ||
}); |
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
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
4481
72
50
9