index.js 529 B

12345678910111213141516
  1. 'use strict';
  2. var v, isElectron = process.versions && process.versions.electron;
  3. if (process.platform === 'win32') {
  4. v = (isElectron ? process.versions.electron : process.version).match(/(\d+\.)(\d+)\./);
  5. if (isElectron || v[1] === '0.') {
  6. v[2] = parseInt(v[2]);
  7. if (!isElectron && v[2] % 2) {
  8. v[2]++;
  9. }
  10. } else {
  11. v[2] = 'x';
  12. }
  13. module.exports = require((isElectron ? './electron/' : './node/') + v[1] + v[2] + '.x' + '/' + process.arch + '/fswin.node');
  14. } else {
  15. throw 'this module only works on windows';
  16. }