
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@cookielab.io/configuration
Advanced tools
This package is meant to help you work with environment variables safely. It is wrapper around [doenv-safe](https://www.npmjs.com/package/dotenv-safe) package.
This package is meant to help you work with environment variables safely. It is wrapper around doenv-safe package.
You have to call loadDotEnvConfig() function to make sure all ENV variables are loaded.
You can ensure their presence in environment by using variable() function to load all ENV variables values. You can also set their default value if not present.
$ npm install --save @cookielab.io/configuration
or
$ yarn add @cookielab.io/configuration
import {loadDotEnvConfig, variable} from '@cookielab.io/configuration';
// assuming .env file in the project root and the config file in ./src/config
loadDotEnvConfig(`${__dirname}/../../`);
export default {
environment: variable('ENVIRONMENT'),
https: variable('HTTPS') === 'enabled',
port: parseInt(variable('PORT', '3000'), 10),
};
variable(name: string, defaultValue?: string): stringThrows an error if the variable is not set and does not have default value.
load(options: Object): voidWrapper around require('dotenv-safe').config. Available options.
loadDotEnvConfig(rootDir: string): voidWrapper around load(). It forces loading of .env.example file to be used as ENV variables source when jest is present.
It also checks DISABLE_DOTENV_CONFIG ENV variable to be true not to use and require .env files at all (for production environment usage).
[0.5.0] 2020-06-17
FAQs
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.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.