I'd say skip the previous lines and go:

    var options =  ['--dbpath', './data', '--pidfilepath', './.dpd/pids/mongod', '--port', port, '-f', fs.existsSync('/dev/null') ? '/dev/null' : 'NUL'];