Conditional Node.js Version Execution

JSON →
library 1.1.1 ·javascript
verified May 27, 2026

If-node-version is a focused utility designed to conditionally execute shell commands or check the current Node.js runtime version against specified semver ranges. It is primarily intended for use in `npm-scripts` or CI/CD environments where different Node.js versions might require varied build or test processes. The package exposes both a command-line interface (CLI) for direct shell scripting and a Node.js API that leverages `child_process.spawn` and `child_process.spawnSync` for programmatic control. The current stable version is 1.1.1. While the project has a slower release cadence, with the last update (v1.1.1) in May 2017 (following v1.1.0 in Feb 2017 and v1.0.0 in Nov 2016), it remains active for its intended purpose. Its key differentiator lies in its simple, `semver`-compliant approach to conditional execution, avoiding more complex environment variable checks or custom script logic.

total hits 14
actors 7 distinct systems
last hit 4d ago AhrefsBot
GPTBot
2
Script
2
ClaudeBot
1
Search engines
3

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇮 Finland · 🇫🇷 France · 🇩🇪 Germany