-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proxy
process
with additional exports
Closes #33.
- Loading branch information
Showing
8 changed files
with
153 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import { | ||
nextTick, | ||
title, | ||
env as environment, | ||
argv, | ||
version, | ||
versions, | ||
on, | ||
addListener, | ||
once, | ||
off, | ||
removeListener, | ||
removeAllListeners, | ||
emit, | ||
prependListener, | ||
prependOnceListener, | ||
listeners, | ||
cwd, | ||
chdir, | ||
umask, | ||
// @ts-ignore | ||
browser as _browser, | ||
// @ts-ignore | ||
binding as _binding | ||
} from 'process/browser.js'; | ||
|
||
function noop() {} | ||
|
||
const browser = /** @type {boolean} */ (_browser); | ||
const emitWarning = noop; | ||
const binding = /** @type {Function} */ (_binding); | ||
const exit = noop; | ||
const pid = 1; | ||
const features = {}; | ||
const kill = noop; | ||
const dlopen = noop; | ||
const uptime = noop; | ||
const memoryUsage = noop; | ||
const uvCounters = noop; | ||
const platform = 'browser'; | ||
const arch = 'browser'; | ||
const execPath = 'browser'; | ||
const execArgv = /** @type {string[]} */ ([]); | ||
|
||
const api = { | ||
nextTick, | ||
title, | ||
browser, | ||
env: environment, | ||
argv, | ||
version, | ||
versions, | ||
on, | ||
addListener, | ||
once, | ||
off, | ||
removeListener, | ||
removeAllListeners, | ||
emit, | ||
emitWarning, | ||
prependListener, | ||
prependOnceListener, | ||
listeners, | ||
binding, | ||
cwd, | ||
chdir, | ||
umask, | ||
exit, | ||
pid, | ||
features, | ||
kill, | ||
dlopen, | ||
uptime, | ||
memoryUsage, | ||
uvCounters, | ||
platform, | ||
arch, | ||
execPath, | ||
execArgv | ||
}; | ||
|
||
export default api; | ||
|
||
export { | ||
nextTick, | ||
title, | ||
browser, | ||
environment as env, | ||
argv, | ||
version, | ||
versions, | ||
on, | ||
addListener, | ||
once, | ||
off, | ||
removeListener, | ||
removeAllListeners, | ||
emit, | ||
emitWarning, | ||
prependListener, | ||
prependOnceListener, | ||
listeners, | ||
binding, | ||
cwd, | ||
chdir, | ||
umask, | ||
exit, | ||
pid, | ||
features, | ||
kill, | ||
dlopen, | ||
uptime, | ||
memoryUsage, | ||
uvCounters, | ||
platform, | ||
arch, | ||
execPath, | ||
execArgv | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from '../process.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters