What do you need to determine with require('os').release().split('.')[0] < 6, I mean what's the reason?
If you need to get Windows OS info you can use: wmic, this command-line tool is available in every Windows OS since Win XP.