Skip to content

add node:console implementation#4984

Merged
anonrig merged 1 commit intomainfrom
yagiz/add-node-console
Sep 4, 2025
Merged

add node:console implementation#4984
anonrig merged 1 commit intomainfrom
yagiz/add-node-console

Conversation

@anonrig
Copy link
Copy Markdown
Member

@anonrig anonrig commented Sep 3, 2025

In reality, node:console differs from globalThis.console and supports additional features. The existing polyfill implementation for node:console just uses globalThis.console methods underneath. For the sake of removing the polyfills from wrangler, here's the implementation.

Polyfill also adds several variables that is not documented (and not used generally out there) such as the following methods/attributes that I didn't add this to this pull-request. I'm not sure if we should add them. I'm leaving this discussion to the reviewers. Ref: https://github.com/unjs/unenv/blob/main/src/runtime/node/console.ts

  • _ignoreErrors
  • _stderr
  • _stdout
  • _times
  • _stdoutErrorHandler
  • _stderrErrorHandler

@anonrig anonrig requested review from a team as code owners September 3, 2025 22:54
@anonrig anonrig requested a review from a team September 3, 2025 22:54
@anonrig anonrig requested a review from a team as a code owner September 3, 2025 22:54
Copy link
Copy Markdown
Member

@npaun npaun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anonrig anonrig merged commit 0a856f1 into main Sep 4, 2025
21 of 22 checks passed
@anonrig anonrig deleted the yagiz/add-node-console branch September 4, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants