nodejs / import-in-the-middle

Like `require-in-the-middle`, but for ESM import
https://www.npmjs.com/package/import-in-the-middle
Apache License 2.0
52 stars 20 forks source link

fix: Use `process.emitWarning` to log errors #114

Closed timfish closed 1 week ago

timfish commented 1 week ago

Uses process.emitWarning rather than console.warn to log error messages when failing to wrap a module.

This means that by default the warnings are truncated. You can get full stack traces by passing --trace-warnings and you can hide the warnings with --no-warnings.