alexbrazier / simple-update-notifier

Simple update notifier to check for npm updates for cli applications
MIT License
17 stars 9 forks source link

Introduce `debug` module style logging #14

Closed voxpelli closed 1 year ago

voxpelli commented 1 year ago

As a follow up to: https://github.com/alexbrazier/simple-update-notifier/pull/12

To make the debugging easier, I would suggest adopting either the debug module in itself or at least the syntax of DEBUG=simple-update-notifier / DEBUG=* to print out debug messages for failures here: https://github.com/alexbrazier/simple-update-notifier/blob/a35efd0ab9ad9f6e300f16d1546c02d72d2a4e31/src/index.ts#L23-L25

I realize that the point of this module is to have a small dependency footprint, so maybe do not add the debug module to do this.

I guess an alternative / simpler approach could also be to simply accept a debug: true flag into simpleUpdateNotifier() and do a console.error() within the catch only when that flag is set to true?

alexbrazier commented 1 year ago

I think my preference would be for adding a flag like debug: true as the original aim of the package was to not have many dependencies.

voxpelli commented 1 year ago

@alexbrazier Want a PR?

alexbrazier commented 1 year ago

@alexbrazier Want a PR?

Sure, if you're happy to create one 😀