node:process
#Import
import process from "nstdlib/node/process";Note
The API is available, but not everything works. Constants are baked in at build time. hrtime() and uptime() are the realm's own monotonic clock, report is a working settings object, constrainedMemory() is 0 (libuv's own "unconstrained"), and the three active-resource lists are empty because there is no libuv queue to walk. memoryUsage(), rss(), availableMemory(), cpuUsage(), threadCpuUsage() and resourceUsage() are placeholders, each announced once through process.emitWarning. chdir(), cwd(), umask(), abort(), kill(), dlopen() and report.writeReport() throw ERR_NSTDLIB_NO_BINDING.
#Support
- nstd: Gives the same output as Node.js in side-by-side tests: options, process, process-methods, signal.
- Browser: Loads with a minimal
processobject. 12 of Node's 84 exports are available. No behavior check covers it yet.
#Exports (86)
Every name Node.js exports from this module, and what you get when you read it, as a named import or as a property of the default import:
- ✅ A value, both ways. An export that throws an error naming the missing feature also counts.
- ⚠️ A value one way,
undefinedthe other. - ❔
undefinedboth ways. - ❌ Not exported at all.
- – Not measured.
Show all 86 exports
| Export | Node.js | Browser |
|---|---|---|
_debugEnd | ✅ | ❌ |
_debugProcess | ✅ | ❌ |
_eval | ✅ | ❌ |
_events | ✅ | ❌ |
_eventsCount | ✅ | ❌ |
_exiting | ✅ | ❌ |
_fatalException | ✅ | ❌ |
_getActiveHandles | ✅ | ❌ |
_getActiveRequests | ✅ | ❌ |
_kill | ✅ | ❌ |
_linkedBinding | ✅ | ❌ |
_maxListeners | ❔ | ❌ |
_preload_modules | ✅ | ❌ |
_rawDebug | ✅ | ❌ |
_startProfilerIdleNotifier | ✅ | ❌ |
_stopProfilerIdleNotifier | ✅ | ❌ |
_tickCallback | ✅ | ❌ |
abort | ✅ | ❌ |
addUncaughtExceptionCaptureCallback | ✅ | ❌ |
allowedNodeEnvironmentFlags | ✅ | ❌ |
arch | ✅ | ✅ |
argv | ✅ | ❌ |
argv0 | ✅ | ❌ |
availableMemory | ✅ | ❌ |
binding | ✅ | ❌ |
chdir | ✅ | ✅ |
config | ✅ | ❌ |
constrainedMemory | ✅ | ❌ |
cpuUsage | ✅ | ❌ |
cwd | ✅ | ✅ |
debugPort | ✅ | ❌ |
dlopen | ✅ | ❌ |
domain | ✅ | ❌ |
emitWarning | ✅ | ✅ |
env | ✅ | ✅ |
execArgv | ✅ | ❌ |
execPath | ✅ | ❌ |
execve | ✅ | ❌ |
exit | ✅ | ❌ |
exitCode | ❔ | ❌ |
features | ✅ | ✅ |
finalization | ✅ | ❌ |
getActiveResourcesInfo | ✅ | ❌ |
getBuiltinModule | ✅ | ❌ |
getegid | ✅ | ❌ |
geteuid | ✅ | ❌ |
getgid | ✅ | ❌ |
getgroups | ✅ | ❌ |
getuid | ✅ | ❌ |
hasUncaughtExceptionCaptureCallback | ✅ | ❌ |
hrtime | ✅ | ❌ |
initgroups | ✅ | ❌ |
kill | ✅ | ❌ |
loadEnvFile | ✅ | ❌ |
memoryUsage | ✅ | ❌ |
moduleLoadList | ✅ | ❌ |
nextTick | ✅ | ✅ |
noDeprecation | ✅ | ❌ |
noProcessWarnings | ✅ | ❌ |
openStdin | ✅ | ❌ |
pid | ✅ | ❌ |
platform | ✅ | ✅ |
ppid | ✅ | ❌ |
reallyExit | ✅ | ❌ |
ref | ✅ | ❌ |
release | ✅ | ✅ |
report | ✅ | ❌ |
resourceUsage | ✅ | ❌ |
setSourceMapsEnabled | ✅ | ❌ |
setUncaughtExceptionCaptureCallback | ✅ | ❌ |
setegid | ✅ | ❌ |
seteuid | ✅ | ❌ |
setgid | ✅ | ❌ |
setgroups | ✅ | ❌ |
setuid | ✅ | ❌ |
sourceMapsEnabled | ✅ | ❌ |
stderr | ✅ | ✅ |
stdin | ✅ | ❌ |
stdout | ✅ | ❌ |
threadCpuUsage | ✅ | ❌ |
title | ✅ | ❌ |
umask | ✅ | ❌ |
unref | ✅ | ❌ |
uptime | ✅ | ❌ |
version | ✅ | ✅ |
versions | ✅ | ✅ |
#Diagnostics
nstdlib running inside Node.js. This isn't an environment it's meant for, so it isn't shown above, but it tells a library problem from an environment one:
coverage: 86/86 of the host's export names answer inside host node. API only. Constants are baked in at build time.hrtime()anduptime()are the realm's own monotonic clock,reportis a working settings object,constrainedMemory()is0(libuv's own "unconstrained"), and the three active-resource lists are empty because there is no libuv queue to walk.memoryUsage(),rss(),availableMemory(),cpuUsage(),threadCpuUsage()andresourceUsage()are placeholders, each announced once throughprocess.emitWarning.chdir(),cwd(),umask(),abort(),kill(),dlopen()andreport.writeReport()throwERR_NSTDLIB_NO_BINDING.smoke: Imports in a clean child process.node-suite: 56/89 of Node's own eligible tests pass with ./dist inside host node. A failure there and in the page is the library's, one only in the page is the engine's.