npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

envar-cli

v1.0.3

Published

Manage your .env variable using ligthweight cli. You can add, update, remove or list your environment variables.

Downloads

7

Readme

envar-cli

Getting Started

envar-cli is lightweight global package for managing .env variables using cli. You can add, update, remove or list environment variables.

💻Install

# with npm
npm install -g envar-cli

📒Usage

Open your terminal on project folder and check the below instructions. To get help please write envar-cli --help on terminal.

Specify The .env File Extension

There are several .env file extension. Default file is .env for envar-cli.

envar-cli supports:

  • .env
  • .env.example
  • .env.local
  • .env.dev
  • .env.development
  • .env.prod
  • .env.production
  • .env.staging
  • .env.preview

Please specify the extension end of the command with --[fileSpecifier]

Select The File Extension

envar-cli [command] [value] [extension]

# Select .env (do not write anything)
#.env is default. No need to write anything.

# .env.example
envar-cli [command] [value] --example

# .env.local
envar-cli [command] [value] --local

# .env.dev
envar-cli [command] [value] --dev

# .env.development
envar-cli [command] [value] --development

# .env.prod
envar-cli [command] [value] --prod

# .env.production
envar-cli [command] [value] --production

# .env.staging
envar-cli [command] [value] --staging

# .env.preview
envar-cli [command] [value] --preview

Add Variable

If .env file is not exists envar-cli will create a blank .env file.

envar-cli add "PORT=9000"
# or
envar-cli add PORT=9000

#with specific .env file --[extension]
envar-cli add PORT=3000 --dev
envar-cli add PORT=8080 --prod

Result:

.env:

PORT=9000

.env.dev:

PORT=3000

.env.prod:

PORT=8080

Add Variable With Comment

If you want to add a comment to your .env file, please use --comment option. It will be add your comment line before the variable. Currently, it works only if variable is newly added.

envar-cli add "SECRET_KEY=github" --comment "# SECRET KEYS"
#or
#with specific .env file --[extension]
envar-cli add "SECRET_KEY=google" --comment "# SECRET KEYS" --prod

Result:

.env:

# SECRET KEYS
SECRET_KEY=github

.env.prod:

# SECRET KEYS
SECRET_KEY=google

Update Variable

To update a variable you can use update command.

envar-cli update SECRET_KEY=github
#or
envar-cli update "SECRET_KEY=github"

#with specific .env file --[extension]
envar-cli update SECRET_KEY=github --prod

If variable not exists you will see a message like this: ❗: <MY_VAR> not found in .env

Remove Variable

Deleting is also simple. Just use remove, del or delete command. And please:

  • Write only variable name not with value.
  • Pay attention to case sensitivity
envar-cli remove SECRET_KEY
#or
envar-cli del "SECRET_KEY"

#with specific .env file --[extension]
envar-cli delete SECRET_KEY --staging

List Variables

To count and see your environment values please use list command.

envar-cli list

#with specific .env file --[extension]
envar-cli list --development

Example Result:

1. PORT=8080
2. SECRET_KEY=github
📄  : 2 variables found in .env