-
Notifications
You must be signed in to change notification settings - Fork 13
/
process.js
executable file
·66 lines (60 loc) · 1.06 KB
/
process.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* globals unknown */
import path from 'path';
function noop() {}
/**
* @param {unknown[]} arguments_
*/
function nextTick(...arguments_) {
const [function_] = arguments_;
arguments_.shift();
setTimeout(function () {
if (typeof function_ === 'function') {
function_.apply(null, arguments_);
}
}, 0);
}
/**
* @param {unknown} name
*/
function binding(name) {
throw new Error('No such module. (Possibly not yet loaded)');
}
const features = {};
const platformName = 'browser';
const pid = 1;
const browser = true;
const environment = {};
/** @type {string[]} */
const argv = [];
let cwd = '/';
function getCwd() {
return cwd;
}
/**
* @param {string} dir
*/
function getChdir(dir) {
cwd = path.resolve(dir, cwd);
}
export {
features,
nextTick,
pid,
browser,
environment as env,
argv,
binding,
getCwd as cwd,
getChdir as chdir,
noop as exit,
noop as kill,
noop as umask,
noop as dlopen,
noop as uptime,
noop as memoryUsage,
noop as uvCounters,
platformName as platform,
platformName as arch,
platformName as execPath,
platformName as title
};