Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dotenv-config-cli

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotenv-config-cli

A dot env config generator. Reads your .env file and generates a config file. Supports TypeScript and JavaScript.

  • 0.1.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

dotenv-config CLI

Test GitHub license

The dotenv-config CLI is a command-line tool that simplifies the process of generating a config file based on your .env file, supporting both TypeScript and JavaScript.

Installation

You can install dotenv-config globally using npm:

npm install -g dotenv-config

Usage

To use dotenv-config, run the following command:

dotenv-config generate
# There are the prompts you will see
? Specify the path to your .env file. The default location is the root directory ('.env'). › .env
? Specify the configuration file path. Default location is 'config/index.ts' or '.js' in the root directory. If specified, the file will be 'config.ts' or '.js' in the specified directory. › config
? Is this a TypeScript project? › (Y/n)

Note: When specifying the path to your configuration file, you have two options:

  1. If you do not provide a path, the configuration file will be located at 'config/index.ts' or '.js' in the root directory of your project.

  2. If you provide a path, the specified directory will be used, and the configuration file will be named 'config.ts' or '.js' within that specified directory.

This note provides additional clarification on how the configuration file path works based on your previous instruction.

The CLI will read your .env file and generate a config file with environment variables.

Example

After running the command, the CLI will generate a config in the root or in the folder you specified.

note:

PRIVATE_KEY=your_private_key_here
SEPOLIA_RPC_URL=https://example.com/rpc
COINMARKETCAP_API_KEY=your_api_key
ETHERSCAN_API_KEY=your_etherscan_api_key
export const envConfig = {
  PRIVATE_KEY: process.env.PRIVATE_KEY,
  SEPOLIA_RPC_URL: process.env.SEPOLIA_RPC_URL,
  COINMARKETCAP_API_KEY: process.env.COINMARKETCAP_API_KEY,
  ETHERSCAN_API_KEY: process.env.ETHERSCAN_API_KEY,
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributions

Contributions are welcome! If you have ideas for improvements or encounter issues, please open an issue or submit a pull request.

How to Contribute

  1. Fork the Repository: Click the "Fork" button on the GitHub page to create your copy of the project.

  2. Clone Your Fork: In your terminal, run the following command, replacing [your-username] with your GitHub username:

    git clone https://github.com/[your-username]/dotenv-config-generator.git
    
  3. Install Dependencies:

    npm install
    
  4. Make Changes: Create a new branch for your changes, make improvements or fixes, and commit your work:

    git checkout -b my-fix
    # or
    git switch -c my-fix
    
  5. Run the Project:

Run the following command to make sure the project is running properly:

dotenv-config generate
  1. Add Tests (if necessary) and Run Them:

    npm run test
    
  2. Push Your Changes to GitHub: Commit your changes and push them to GitHub. Then, open a pull request against the main branch.

    git add .
    git commit -m "Fix: Describe your fix or feature"
    

FAQs

Package last updated on 08 Nov 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc