Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
cooler-env
Advanced tools
CLI + module utility to help you manage your environment variables better. Inspired by Ruby on Rails credentials.
Cooler-Env is a CLI + module utility to help you manage your environment variables better. It is inspired by Ruby on Rails credentials, and operates similarly.
The point of Cooler-Env is to drastically reduce the amount of time a sensitive plain-text key is visible and to provide an intuitive interface to manage keys.
Cooler-Env is a CLI utility and a module for use in your project.
NPM
npm install cooler-env
Yarn
yarn add cooler-env
To set up a project for the first time with Cooler-Env you will need to perform an init. Here is a sample command:
cooler-env init -e development
This command will set up two files - a .enc file and a .key file. The .enc file is an encrypted binary containing all of your keys that can be safely committed to version control. The .key file is your secret key file that is used to decrypt the binary file.
WARNING: DO NOT CHECK THE .KEY FILE INTO VERSION CONTROL OTHERWISE YOUR KEYS CAN BE DECRYPTED AND EXPOSED.
When you're ready to add a new environment variable key you can use this command. It will open up an interactive interface to create a key and a value. Here is a sample command:
cooler-env add -e development
When you need to change an environment variable key you can use this command. It will open up an interactive interface to select a key to edit and to provide a new value for it. Here is a sample command:
cooler-env edit -e development
When you need to delete an environment variable key you can use this command. It will open up an interactive interface to select a key to delete. Here is a sample command:
cooler-env delete -e development
Cooler-Env comes with a helper function called loadEnv
that is meant to load all of your environment variables into process.env
and return a promise. You will use this function in your application's code before using any of the environment variables.
This function takes two arguments: the first is your application's environment (usually passing process.env.NODE_ENV
), and the second is optionally adding the directory path you want to use for your encryption key and encrypted files. This will default to "config".
Sample usage:
import { loadEnv } from "cooler-env/dist/loadEnv";
// Example IIFE async function
(async () => {
await loadEnv(process.env.NODE_ENV);
})();
FAQs
CLI + module utility to help you manage your environment variables better. Inspired by Ruby on Rails credentials.
We found that cooler-env demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.