Skip to content

Universal .env Package Manager to help create .env files at will

License

Notifications You must be signed in to change notification settings

Sweetdevil144/dotgenv

Repository files navigation

dotgenv

Our DevTo Blog Link

Description

dotgenv is a comprehensive and versatile tool aimed at simplifying the management of environment variables and secrets. This robust utility streamlines the process of handling sensitive information like API keys and configuration parameters, ensuring a more secure and efficient development workflow. Designed with simplicity and functionality in mind, dotgenv is an ideal choice for developers looking to enhance their project's configuration management.

Features

  • Environment Variable Management: Easily set, update, and delete environment variables.
  • Seamless Integration: Quick to set up with existing Node.js projects.
  • Secure Secrets Handling: Offers a safer way to handle API keys and other confidential data.
  • Interactive CLI: Intuitive command-line interface to manage configurations interactively.

Installation

To install dotgenv, simply run the following command in your terminal:

npm install dotgenv

Usage

Once installed, dotgenv can be easily utilized within your Node.js applications. Here's a quick guide on how to use it:

Setting an Environment Variable

const { setEnv } = require('dotgenv');

setEnv('API_KEY', 'your-api-key-here');

Retrieving an Environment Variable

const { getEnv } = require('dotgenv');

const apiKey = getEnv('API_KEY');
console.log(apiKey);

Deleting an Environment Variable

const { deleteEnv } = require('dotgenv');

deleteEnv('API_KEY');

Contributing

Contributions are what make the open source community such a fantastic place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Author

Abhinav Pandey - Initial Work - AbhinavPandey

Acknowledgements

Contact

Abhinav Pandey : [email protected]

Project Link: https://github.com/Sweetdevil144/dotgenv