![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
node-files-env
Advanced tools
Parse and load environment files (containing ENV variable exports) into Node.js environment, i.e. process.env
.
.env
# some env variables
FOO=foo1
BAR=bar1
BAZ=1
QUX=
# QUUX=
.env2
# some env variables using exports syntax
exports FOO=foo2
exports BAR=bar2
exports BAZ=2
exports QUX=
# exports QUUX=
index.js
var assert = require('assert');
var env = require('node-env-file');
process.env.FOO = "defaultfoo";
// Load any undefined ENV variables form a specified file.
env(__dirname + '/.env');
assert.equal(process.env.FOO, "defaultfoo");
assert.equal(process.env.BAR, "bar1");
assert.equal(process.env.BAZ, "1");
assert.equal(process.env.QUX, "");
assert.equal(process.env.QUUX, undefined);
// Load another ENV file - and overwrite any defined ENV variables.
env(__dirname + '/.env2', {overwrite: true});
assert.equal(process.env.FOO, "foo2");
assert.equal(process.env.BAR, "bar2");
assert.equal(process.env.BAZ, "2");
assert.equal(process.env.QUX, "");
assert.equal(process.env.QUUX, undefined);
(filepath)
env('./path/to/.env');
(filepath, options)
env('./path/to/.env', {verbose: true, overwrite: true});
$ npm install node-env-file
Local tests:
$ make test
Local examples:
$ make example
Makefile
define LOAD_ENV
ENV_FILE=$${2:-'.env'}
echo "LOAD: $$ENV_FILE"
if [ -f $$ENV_FILE ]; then
while read line || [ -n "$$line" ]; do
if [[ "$$line" == *=* ]] && [[ "$$line" != #* ]]; then
# TODO: handle exports case
echo " export $$line"
eval "export $$line"
fi
done < "$$ENV_FILE"
fi
endef
export LOAD_ENV
env:
eval "$$LOAD_ENV"
...
Released under the MIT license.
Copyright (c) Jonas Grimfelt
FAQs
Fork from node-env-files, but working better. i.e. `process.env`.
We found that node-files-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.