Specify namespace with url in ESM #948
Labels
change-minor
This proposes or provides a change that requires a minor release
feature
This proposes or provides a feature or enhancement
Milestone
When using native esm in Node, it's not possible anymore to use the pattern
and we have to do
instead. In one of my projects, I've found myself to use an alternative approach though, where I do something like
so that it becomes possible to do stuff like
I was wondering whether it would be useful to have this functionality in the library itself. I'd be happy to clean my code up a bit and file a PR for this. An alternative approach would be to create my own npm module on top of the debug module if it's not desirable to have this in the library itself.
For the syntax, I was thinking about something like
where
debug/url
can become an exports in the package.json.The url approach can be used to add more functionality as well, for example to force a specific color or something:
I'd love to hear some thoughts about this from the maintainers.
The text was updated successfully, but these errors were encountered: