Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): Add console module #892

Merged
merged 1 commit into from
May 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ deno standard library as it's a compatibility module.
- [x] buffer
- [x] child_process _partly_
- [ ] cluster
- [ ] console
- [x] console _partly_
- [x] constants _partly_
- [x] crypto _partly_
- [ ] dgram
Expand Down
23 changes: 23 additions & 0 deletions node/console.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default console;

export const {
assert,
clear,
count,
countReset,
debug,
dir,
dirxml,
error,
group,
groupCollapsed,
groupEnd,
info,
log,
table,
time,
timeEnd,
timeLog,
trace,
warn,
} = console;
2 changes: 2 additions & 0 deletions node/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import "./global.ts";
import nodeAssert from "./assert.ts";
import nodeBuffer from "./buffer.ts";
import nodeCrypto from "./crypto.ts";
import nodeConsole from "./console.ts";
import nodeConstants from "./constants.ts";
import nodeChildProcess from "./child_process.ts";
import nodeEvents from "./events.ts";
Expand Down Expand Up @@ -637,6 +638,7 @@ nativeModulePolyfill.set("timers", createNativeModule("timers", nodeTimers));
nativeModulePolyfill.set("tty", createNativeModule("tty", nodeTty));
nativeModulePolyfill.set("url", createNativeModule("url", nodeUrl));
nativeModulePolyfill.set("util", createNativeModule("util", nodeUtil));
nativeModulePolyfill.set("console", createNativeModule("console", nodeConsole));

function loadNativeModule(
_filename: string,
Expand Down