arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.12k stars 65 forks source link

Better support for `console.log` #115

Closed Ayc0 closed 2 years ago

Ayc0 commented 2 years ago

The doc seems to be recommending to use this.context.stdout.write instead of console.log:

image

But those 2 don't do exactly the same things:

code console.log stdout.write
image image image
image image image
image image image

Here there a plan to include a fully compatible console (like this.context.console) that would work with clipanion and that would be 100% compatible with the console.* APIs?

merceyz commented 2 years ago

You can set enableCapture: true to have Clipanion redirect console.* to the correct streams https://mael.dev/clipanion/docs/contexts https://github.com/arcanis/clipanion/pull/103

Ayc0 commented 2 years ago

That's sweet! I didn't know that.

Do you think we should add a link to this page, or say something like "We also recommend you to enable enableCapture: true if you want to still use console.log" in this help box?