process.js 854 B

1234567891011121314151617181920212223242526272829
  1. var immediate = require('immediate');
  2. var process = module.exports = {};
  3. process.nextTick = immediate
  4. process.title = 'browser';
  5. process.browser = true;
  6. process.env = {};
  7. process.argv = [];
  8. process.version = ''; // empty string to avoid regexp issues
  9. process.versions = {};
  10. function noop() {}
  11. process.on = noop;
  12. process.addListener = noop;
  13. process.once = noop;
  14. process.off = noop;
  15. process.removeListener = noop;
  16. process.removeAllListeners = noop;
  17. process.emit = noop;
  18. process.prependListener = noop;
  19. process.prependOnceListener = noop;
  20. process.listeners = function (name) { return [] }
  21. process.binding = function (name) {
  22. throw new Error('process.binding is not supported');
  23. };
  24. process.cwd = function () { return '/' };
  25. process.chdir = function (dir) {
  26. throw new Error('process.chdir is not supported');
  27. };
  28. process.umask = function() { return 0; };