Closed longnguyen2004 closed 5 months ago
I just realized p-cancelable
is ESM...If we were to go this route then this library needs to be changed to ESM also
@longnguyen2004 iirc you can use dynamic import at commonjs
I don't really want to use dynamic imports because it needlessly complicates logic for simple use cases, I'd rather have everything be ESM or CommonJS. I'm in the process of converting this library to ESM. Hope it won't be too much of a breaking change to users.
@longnguyen2004 but iirc changing the package from cjs to ejs would affect cjs users, am I right?
It'll be a breaking change yes, but the situation now is a lot better than when ESM was first added to Node a few years ago, and there shouldn't be many cases where you have to use CJS anymore. Also, people who are using TypeScript are already using ESM syntaxes, but aren't aware that TS transpiles it to CJS by default. Switching to ESM for such people will be even easier.
alr
This is an implementation of my suggestion in https://github.com/dank074/Discord-video-stream/issues/88#issuecomment-2074024524
Usage: