Gathering detailed insights and metrics for lazy-universal-dotenv
Gathering detailed insights and metrics for lazy-universal-dotenv
Gathering detailed insights and metrics for lazy-universal-dotenv
Gathering detailed insights and metrics for lazy-universal-dotenv
Robust Environment Configuration for Universal Applications.
npm install lazy-universal-dotenv
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.9
Supply Chain
94.4
Quality
79.2
Maintenance
100
Vulnerability
100
License
JavaScript (98.1%)
Shell (1.9%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
10 Stars
81 Commits
6 Forks
3 Watchers
1 Branches
98 Contributors
Updated on Jun 15, 2024
Latest Version
4.0.0
Package Id
lazy-universal-dotenv@4.0.0
Unpacked Size
17.34 kB
Size
5.92 kB
File Count
5
NPM Version
8.15.0
Node Version
16.17.1
Published on
Jan 30, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
Lazy Universal DotEnv - A Robust Environment Configuration for Universal Applications.
.env
files with overriding between different NODE_ENV
settings and BUILD_TARGET
configurations.It is important to remember that all environment variables are always stored as strings. Even numbers and booleans. The casting to other types must therefore take place in the application code. See also: https://github.com/motdotla/dotenv/issues/51
NODE_ENV
: Typically either production
, development
or test
BUILD_TARGET
: Either client
or server
Files are being loaded in this order. Values which are already set are never overwritten. Command line environment settings e.g. via cross-env always win.
.env.${BUILD_TARGET}.${NODE_ENV}.local
.env.${BUILD_TARGET}.${NODE_ENV}
.env.${BUILD_TARGET}.local
.env.${BUILD_TARGET}
.env.${NODE_ENV}.local
.env.${NODE_ENV}
.env.local
.env
Note: local
files without NODE_ENV
are not respected when running in NODE_ENV=test
.
1import { getEnvironment } from "lazy-dotenv-universal"; 2 3const environment = getEnvironment({ nodeEnv, buildTarget }); 4 5const { raw, stringified, webpack } = environment;
After this you can access all environment settings you have defined in one of your .env
files.
A .env file:
MY_END=awesome
Webpack config:
1import { getEnvironment } from "lazy-dotenv-universal"; 2 3export default { 4 // ... 5 plugins: [ 6 new webpack.DefinePlugin(getEnvironment().webpack), 7 ], 8 // ... 9}
Code being bundled by webpack:
1console.log(process.env.MY_ENV); // -> "awesome"
Apache License Version 2.0, January 2004
Copyright 2018
Sebastian Software GmbH
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
9 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More