Check if your code is running on NW.js on Mac.
$ npm install --save is-nwjs-mac
var isNwjsMac = require('is-nwjs-mac');
// on your browser
console.log(isNwjsMac);
//=> false
// on NW.js on Windows
console.log(isNwjsMac);
//=> false
// on NW.js on Mac
console.log(isNwjsMac);
//=> true
MIT © sanemat