node:console
#Import
import console from "nstdlib/node/console";Note
Behaves like Node.js. The whole namespace is diffed in child realms, writes to process.stdout/stderr included. The five inspector names answer what the host answers with no debugger attached. profile, profileEnd, timeStamp and context accept and drop, and createTask runs its callback for real.
#Support
- nstd: 17/22 of Node's own eligible tests pass under nstd.
- Browser: Loads with a minimal
processobject. 30 of Node's 31 exports are available. No behavior check covers it yet.
#Exports (31)
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.
| Export | Node.js | Browser |
|---|---|---|
Console | ✅ | ✅ |
_ignoreErrors | ✅ | ✅ |
_stderr | ✅ | ✅ |
_stderrErrorHandler | ✅ | ✅ |
_stdout | ✅ | ❌ |
_stdoutErrorHandler | ✅ | ✅ |
_times | ✅ | ✅ |
assert | ✅ | ✅ |
clear | ✅ | ✅ |
context | ✅ | ✅ |
count | ✅ | ✅ |
countReset | ✅ | ✅ |
createTask | ✅ | ✅ |
debug | ✅ | ✅ |
dir | ✅ | ✅ |
dirxml | ✅ | ✅ |
error | ✅ | ✅ |
group | ✅ | ✅ |
groupCollapsed | ✅ | ✅ |
groupEnd | ✅ | ✅ |
info | ✅ | ✅ |
log | ✅ | ✅ |
profile | ✅ | ✅ |
profileEnd | ✅ | ✅ |
table | ✅ | ✅ |
time | ✅ | ✅ |
timeEnd | ✅ | ✅ |
timeLog | ✅ | ✅ |
timeStamp | ✅ | ✅ |
trace | ✅ | ✅ |
warn | ✅ | ✅ |
#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: 31/31 of the host's export names answer inside host node. Behaviour verified against the host builtin. The whole namespace is diffed in child realms, writes toprocess.stdout/stderrincluded. The five inspector names answer what the host answers with no debugger attached.profile,profileEnd,timeStampandcontextaccept and drop, andcreateTaskruns its callback for real.smoke: Imports in a clean child process.node-suite: 18/22 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.