check-os

Check if the current operating system is what you need

Usage

Install

const os = require('check-os')

In code

if(os.isWindows) {...} //Check if current os is Windows
if(os.isMacOS) {...} //Check if current os is MacOS
if(os.isLinux) {...} //Check if current os is Linux
if(os.isSunOs) {...} //Check if current os is SunOS
if(os.FreeBSD) {...} //Check if current os is FreeBSD