sindresorhus / meow

šŸˆ CLI app helper
MIT License
3.53k stars 150 forks source link

Document ES Modules usage #147

Closed jimthedev closed 4 years ago

jimthedev commented 4 years ago

Closes #130.

sindresorhus commented 4 years ago

Can you also add Node.js 14 here: https://github.com/sindresorhus/meow/blob/c67d9f4f8813d03a97637d8460274e63956cd096/.travis.yml#L3

jimthedev commented 4 years ago

@sindresorhus added 14 to Travis, also made the esm test conditional on node 14 and greater since otherwise itā€™ll throw an error. Let me know if thereā€™s a different way youā€™d prefer to handle that one.

jimthedev commented 4 years ago

Ok RTG, @sindresorhus! Thanks for this project and all your projects.

jimthedev commented 4 years ago

..

jimthedev commented 4 years ago

Ok I updated this one (which is now ready to review @sindresorhus). According to https://twitter.com/MylesBorins/status/1255950295806488576 it looks like basically the user must use createRequire if they want to keep using this in ES modules (but they are doing so using commonjs). Seems ok for now?

I am open to other ideas on how to accomplish this but at least it would unblock people looking to use it in their ES based cli's.

sindresorhus commented 4 years ago

Thanks :)