browser.js 975 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. exports.endianness = function () { return 'LE' };
  2. exports.hostname = function () {
  3. if (typeof location !== 'undefined') {
  4. return location.hostname
  5. }
  6. else return '';
  7. };
  8. exports.loadavg = function () { return [] };
  9. exports.uptime = function () { return 0 };
  10. exports.freemem = function () {
  11. return Number.MAX_VALUE;
  12. };
  13. exports.totalmem = function () {
  14. return Number.MAX_VALUE;
  15. };
  16. exports.cpus = function () { return [] };
  17. exports.type = function () { return 'Browser' };
  18. exports.release = function () {
  19. if (typeof navigator !== 'undefined') {
  20. return navigator.appVersion;
  21. }
  22. return '';
  23. };
  24. exports.networkInterfaces
  25. = exports.getNetworkInterfaces
  26. = function () { return {} };
  27. exports.arch = function () { return 'javascript' };
  28. exports.platform = function () { return 'browser' };
  29. exports.tmpdir = exports.tmpDir = function () {
  30. return '/tmp';
  31. };
  32. exports.EOL = '\n';
  33. exports.homedir = function () {
  34. return '/'
  35. };