Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
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.
envari
Advanced tools
Readme
A safer way to load .env files
npm i envari
or
yarn add envari
properties
: The properties that should be present in the .env filemissingPropertyBehavior
: The action that should be taken if a required property is missing
"THROW"
(default): Throw an error"FALLBACK"
: Use an empty string for the property insteadfilePath
: The file path to the .env file (defaults to the .env file in the project root)# .env
SECRET_KEY="******"
// env.js
import * as Envari from "envari";
export const env = Envari.load({
properties: {
SECRET_KEY: true,
},
});
The result of calling Envari.load
will be an object representation of your .env
file.
Envari also automatically populates process.env
with your .env
values.
// index.js
import { env } from "/env.js";
console.log(env.SECRET_KEY); // "******"
console.log(process.env.SECRET_KEY); // "******"
import * as Envari from "envari";
const env = Envari.load({
properties: {
SECRET_KEY: true,
SUPER_SECRET_KEY: true,
},
missingPropertyBehavior: "FALLBACK",
filePath: "./some/path/to/.env",
});
console.log(env); // { SECRET_KEY: "******", SUPER_SECRET_KEY: "" }
MIT © Juan de Urtubey
FAQs
A safer way to load .env files
The npm package envari receives a total of 2 weekly downloads. As such, envari popularity was classified as not popular.
We found that envari 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
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.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.