
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
check-env-cli
Advanced tools
This CLI was created having a specific case. I had a script like
"prepare":"husky install"
and I wanted to run it only during non-production install ( because husky was a dev dependency )
So then I thought - it would be nice to check environment variable NODE_ENV which is prefilled with production value in case of using --production flag for npm install
Then I decided to solve this task in a generig way with this module
For the mentioned above problem now my code looks like this:
"prepare":"check NODE_ENV=production || husky install"
So as you see it's a very minimalistic implementation without complicated conditions or OS-dependent if statements but allowing to use any environment variable. You can also wrap it to another script for reusability. Another trick is to use it via npx - thus you won't need to declare this module as a global depenendcy for your package.
"prepare": "npm run is-prod || husky install",
"is-prod": "npx -y check-env-cli NODE_ENV=production"
FAQs
Environment variables checker (CLI)
The npm package check-env-cli receives a total of 953 weekly downloads. As such, check-env-cli popularity was classified as not popular.
We found that check-env-cli 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.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.