title
title copied to clipboard
Update all dependencies to latest and support ESM
It'd be great to support both ESM and CJS here.
https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
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:
- 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?
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.
https://github.com/vercel/ms/pull/163