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

Update all dependencies to latest and support ESM #69

Closed
leerob opened this issue Feb 12, 2022 · 2 comments · Fixed by #86
Closed

Update all dependencies to latest and support ESM #69

leerob opened this issue Feb 12, 2022 · 2 comments · Fixed by #86

Comments

@leerob
Copy link
Member

leerob commented Feb 12, 2022

It'd be great to support both ESM and CJS here.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

@bryan-hoang
Copy link
Contributor

support both ESM and CJS

I'd like to clarify my interpretation of the intent of the issue. The way I understand it, we'd like to convert the (currently) CommonJS title package into a pure ESM project. That would imply a breaking change for CommonJS consumers of the title package that would force them to pursue one of the 3 options presented at the beginning of the linked gist.

i.e., the "support" for CJS would come from the following point made in the gist:

  1. If the package [e.g., title] is used in an async context, you could use await import(…) from CommonJS instead of require(…).

Would that interpretation be correct?

@leerob
Copy link
Member Author

leerob commented Feb 16, 2022

So that document shows how to make a pure ESM package. There are pros to that. If possible, it would be great to support both CJS and ESM for best backwards compat. I'm not an expert here, but ms recently made this change.

vercel/ms#163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants