Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dotenv

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotenv - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

28

lib/main.js

@@ -19,6 +19,9 @@ "use strict";

_getKeyAndValueFromLine: function(line) {
var key_value_array = line.match(/^\s*([\w\.\-\_]+)\s*=\s*(.*?)\s*$/);
var key = key_value_array[1].trim();
var value = key_value_array[2].trim();
var key_value_array = line.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/);
if (!key_value_array) return null;
var key = key_value_array[1];
var value = key_value_array[2];
if (value.charAt(0) === '"' && value.charAt(value.length-1) == '"') {

@@ -32,3 +35,4 @@ value = value.replace(/\\n/gm, "\n");

_getKeysAndValuesFromEnvFilePath: function(filepath) {
var data, content, lines;
var data, content, lines, keys_and_values;
try {

@@ -43,14 +47,12 @@ data = fs.readFileSync(filepath);

for (var i=0; i<lines.length; i++) {
try {
var array = dotenv._getKeyAndValueFromLine(lines[i]);
var key = array[0];
var value = array[1];
keys_and_values = lines.map(dotenv._getKeyAndValueFromLine)
.filter(Array.isArray);
keys_and_values.forEach(function(pair) {
var key = pair[0];
var value = pair[1];
dotenv.keys_and_values[key] = value;
} catch (e) {
}
})
}
return true;

@@ -57,0 +59,0 @@ },

{
"name": "dotenv",
"version": "0.2.3",
"version": "0.2.4",
"description": "Loads environment variables from .env",

@@ -5,0 +5,0 @@ "main": "lib/main.js",

@@ -23,3 +23,3 @@ # dotenv

IMPORTANT: In pre `0.2.3`, you instantiated dotenv like the following with the bagels.
IMPORTANT: In pre `0.2.0`, you instantiated dotenv like the following with the bagels.

@@ -26,0 +26,0 @@ ```javascript

@@ -13,3 +13,3 @@ var assert = require('assert'),

it('version should be set', function() {
result.version.should.eql("0.2.3");
result.version.should.eql("0.2.4");
});

@@ -16,0 +16,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc