1.0.0 • Published 2 years ago
@gtamo/cli-check-node v1.0.0
cli-check-node
- ✅ Checks if a Node app is running on the right Node version
- ❌ Fails with a message to update Node version to specified version
Install
npm install @gtamo/cli-check-node
Usage
import checkNode from '@gtamo/cli-check-node';
checkNode('13'); // Fails the script if current node version is less than 13.
API
checkNode(requiredNodeVersion, options?)
❯ requiredNodeVersion
Type: string
❯ options
Type: object
Default: {fail: true}
(optional)
You can specify the options below.
❯ fail
Type: boolean
Default: true
(optional)
checkNode('13', {fail: false});
// Notifies if current node version is less than 13. Does NOT fail.