function parseEnvFile(str) {
	return str.split(NEWLINE_ALL).reduce((acc, line) => {
		const match = line.match(KEY_VAL);
		if (match) {
			const key = match[1];
			// Convert missing value to empty string
			let value = match[2] || '';

			const last = value.length - 1;
			const doubleQuotes = value[0] === '"' && value[last] === '"';
			const singleQuotes = value[0] === "'" && value[last] === "'";

			if (singleQuotes || doubleQuotes) {
				value = value.substring(1, last);

				if (doubleQuotes) {
					value = value.replace(/\\n/g, '\n');
				}
			} else {
				value = value.trim();
			}

			acc[key] = value;
		}
		return acc;
	}, {});
}
Parse env file format.
Example
  FOO="bar"
  Bob=
  BOOF='baz'
  BAR=123
  BOING="bar\\nboof\\n"
@param {string} str