forked from michaljaz/webmc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.js
More file actions
37 lines (30 loc) · 888 Bytes
/
process.js
File metadata and controls
37 lines (30 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// shim for using process in browser
const process = module.exports = {}
process.nextTick = function (fun, ...args) {
setTimeout(() => { fun(...args) }, 0)
}
process.title = 'browser'
process.browser = true
process.env = {}
process.argv = []
process.version = '' // empty string to avoid regexp issues
process.versions = {}
function noop () { }
process.on = noop
process.addListener = noop
process.once = noop
process.off = noop
process.removeListener = noop
process.removeAllListeners = noop
process.emit = noop
process.prependListener = noop
process.prependOnceListener = noop
process.listeners = function () { return [] }
process.binding = function () {
throw new Error('process.binding is not supported')
}
process.cwd = function () { return '/' }
process.chdir = function () {
throw new Error('process.chdir is not supported')
}
process.umask = function () { return 0 }