{"library":"if-node-version","type":"library","category":null,"description":"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.","language":"javascript","status":"active","version":"1.1.1","tags":["javascript","node","version","semver","range","check","compare","conditional","less"],"last_verified":"Wed May 27","install":[{"cmd":"npm install if-node-version","imports":["const spawnIfNodeVersion = require('if-node-version');","const syncSpawn = require('if-node-version').sync;","npx if-node-version \">=16\" some-command --arg"]},{"cmd":"yarn add if-node-version","imports":[]},{"cmd":"pnpm add if-node-version","imports":[]}],"homepage":null,"github":"https://github.com/mysticatea/if-node-version","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/if-node-version","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/if-node-version/compatibility"}}