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

Document ES Modules usage #147

Merged
merged 4 commits into from May 3, 2020
Merged

Conversation

jimthedev
Copy link
Contributor

Closes #130.

@sindresorhus
Copy link
Owner

Can you also add Node.js 14 here:

- '12'

@jimthedev jimthedev force-pushed the master branch 2 times, most recently from c4d6079 to f45ccd6 Compare April 27, 2020 17:07
@jimthedev
Copy link
Contributor Author

@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
Copy link
Contributor Author

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

@jimthedev
Copy link
Contributor Author

jimthedev commented Apr 28, 2020

..

@jimthedev jimthedev force-pushed the master branch 6 times, most recently from 30bd878 to 6adbec0 Compare May 1, 2020 01:15
@@ -0,0 +1 @@
estest/index.js
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must ignore this file due to eslint/eslint#13133

@jimthedev
Copy link
Contributor Author

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.

@jimthedev jimthedev changed the title fix: enable es modules Add ES Modules usage and test May 1, 2020
@sindresorhus sindresorhus changed the title Add ES Modules usage and test Document ES Modules usage May 3, 2020
@sindresorhus sindresorhus merged commit 0ff59c6 into sindresorhus:master May 3, 2020
@sindresorhus
Copy link
Owner

Thanks :)

sindresorhus pushed a commit that referenced this pull request May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support ES module scripts?
2 participants