Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
dot-env-json
Advanced tools
Readme
Package similar to dotenv to read from .json files. It looks for files based on NODE_ENV. Ex: .env.development.json
import dotenv from "dot-env-json";
dotenv();
node -r dot-env-json/lib/config
# change base directory from root
node -r dot-env-json/lib/config dotenv_config_base=config/
Accepts an options object. Only valid option currently is base which sets the base path to look for files.
import dotenv from "dot-env-json";
# approot/config/.env.development.json
dotenv({
base: "config/"
});
Since this package uses NODE_ENV it is recommended to use the cross-env package to set the environment in your run scripts
# gets the json file approot/env.test.json
cross-env NODE_ENV=test node -r dot-env-json/lib/config yourfile.js
# gets the json file approot/config/env.development.json
cross-env NODE_ENV=development node -r dot-env-json/lib/config dotenv_config_base=config/ yourfile.js
FAQs
package similar to dotenv that reads from JSON file.
The npm package dot-env-json receives a total of 8 weekly downloads. As such, dot-env-json popularity was classified as not popular.
We found that dot-env-json 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.