And a quick test flow:
[{"id":"3aba606e3d187d8b","type":"group","z":"d0860be6.7951b8","name":"Check node.js versions","style":{"fill":"#e3f3d3","fill-opacity":"0.47","label":true,"color":"#000000"},"nodes":["fb54ce55d98d7d34","6413c730059274c2","8adc5a6b529afeeb","f9f5e3edbfdb44a7"],"x":94,"y":3639,"w":972,"h":82,"info":"NB: AI Generated.\r\n\r\n## Check Node LTS Version\r\n\r\nTo programmatically check whether the installed version of Node.js is an LTS version, you can use\r\nthe process.release.lts property within a Node.js script. This property will be undefined for\r\nnon-LTS versions and will contain the name of the LTS line for LTS versions.\r\n\r\nHere is an example of how you can check this in a Node.js script:\r\n\r\n```js\r\nconsole.log(process.release.lts);\r\n```\r\n\r\nIf the installed version is an LTS version, the script will output the name of the LTS line,\r\nsuch as Argon or Gallium. If it is not an LTS version, the output will be undefined.\r\n\r\nAdditionally, you can fetch the latest LTS version details from the Node.js release API and\r\ncompare it with the installed version. Here is a more detailed script that does this:\r\n\r\n```js\r\nconst https = require('https');\r\n\r\nhttps.get('https://nodejs.org/dist/index.json', (res) => {\r\n let data = '';\r\n\r\n res.on('data', (chunk) => {\r\n data += chunk;\r\n });\r\n\r\n res.on('end', () => {\r\n const releases = JSON.parse(data);\r\n const latestLTS = releases.find((release) => release.lts);\r\n const installedVersion = process.version;\r\n\r\n console.log(`Latest LTS version: ${latestLTS.version}`);\r\n console.log(`Installed version: ${installedVersion}`);\r\n\r\n if (latestLTS.version === installedVersion) {\r\n console.log('The installed version is an LTS version.');\r\n } else {\r\n console.log('The installed version is not an LTS version.');\r\n }\r\n });\r\n}).on('error', (err) => {\r\n console.error(`Error: ${err.message}`);\r\n});\r\n```\r\n\r\nThis script fetches the latest LTS version from the Node.js release API and compares it with the\r\ninstalled version to determine if the installed version is an LTS version."},{"id":"fb54ce55d98d7d34","type":"inject","z":"d0860be6.7951b8","g":"3aba606e3d187d8b","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"2142000","crontab":"","once":true,"onceDelay":"10","topic":"check-nodejs-version","x":155,"y":3680,"wires":[["8adc5a6b529afeeb"]],"l":false},{"id":"6413c730059274c2","type":"debug","z":"d0860be6.7951b8","g":"3aba606e3d187d8b","name":"debug 37","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":960,"y":3680,"wires":[]},{"id":"8adc5a6b529afeeb","type":"http request","z":"d0860be6.7951b8","g":"3aba606e3d187d8b","name":"Get node.js versions","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://nodejs.org/dist/index.json","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":300,"y":3680,"wires":[["f9f5e3edbfdb44a7"]]},{"id":"f9f5e3edbfdb44a7","type":"function","z":"d0860be6.7951b8","g":"3aba606e3d187d8b","name":"function 4","func":"const releases = msg.payload\n\nconst latestLTS = releases.find((release) => release.lts)\n\nconst installedVersion = process.version\n\nconst installedDetails = releases.find((release) => release.version === installedVersion)\n\nconst isIninstalledLTS = installedDetails.lts !== false\n\nconsole.log(`Latest LTS version: ${latestLTS.version}, LTS: ${latestLTS.lts}`)\nconsole.log(`Installed version: ${installedVersion}. From details: ${installedDetails.version}, LTS ${installedDetails.lts}`);\n\nif (isIninstalledLTS === true) {\n console.log('The installed version is an LTS version.');\n} else {\n console.log('The installed version is not an LTS version.');\n}\n\nreturn {\n isInstalledLTS: isIninstalledLTS,\n installed: installedVersion,\n installedDetails: installedDetails,\n latestLTS: latestLTS,\n releases: releases,\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"process","module":"process"}],"x":500,"y":3680,"wires":[["6413c730059274c2"]]}]