
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
Posix compatible shell script that makes loading environment variables from multiple .env files easy, while respecting ones already set.
Posix compatible shell script that makes loading environment variables from multiple .env files easy, while respecting ones already set.
Environment files are a handy way in local development to define the configurable values. They are important to the concept of the 12 factor app. Within node development the npm dotenv package makes loading multiple of such files easy while not overwriting values from the host environment. However loading such files in a shell environment is tricky. This utility shell script makes that easy.
npm install shenv
Set up of example host environment and .env files.
export ENV_1=host
echo '
ENV_1=a
ENV_2=a
' > a.env
echo '
ENV_2=b
ENV_3=b
' > b.env
Load all that into the current shell context with:
eval $(./shenv.sh a.env b.env)
In the above example shenv.sh will output:
export ENV_2=a
export ENV_3=b
By executing shenv.sh in a subshell with eval $(./shenv ...) the export string above is eval'd and the values are available as environment variables in the current shell's context.
The output is posix compatible shell export commands that has been tested compatible with safe characters. Further testing is need for things like unicode support.
The objective is to load environment files that meet the dotenv Rules.
FAQs
Posix compatible shell script that makes loading environment variables from multiple .env files easy, while respecting ones already set.
We found that shenv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.