process.platform
The variable to use would be process.platform
On Mac the variable returns darwin. On Windows, it returns win32 (even on 64 bit).
Possible values are: ‘darwin’, ‘freebsd’, ‘linux’, ‘sunos’ or ‘win32’
I just set this at the top of my jakeFile:
var isWin = /^win/.test(process.platform);