Skip to content

Issue #4788 - ESM Module Example #4794

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

Open
wants to merge 2 commits into
base: 5.0
Choose a base branch
from

Conversation

Segmentational
Copy link

@Segmentational Segmentational commented Jan 25, 2022

It's getting incredibly late here, but I mocked up a quick example that demonstrates how to use express via an ESM module. I've been using ECMA modules for a little while now, and can include a much more complex example upon request. There's a bit of power using modules vs. the CommonJS approach. Imho, as an example, it's a bit easier to add middleware. There's a lot of ease, too, when using async.

However, express@^5 is required. I believe this has to do with the impressive compatibility express has kept with the various node versions.

@Segmentational
Copy link
Author

Whoops, I forgot to mention Issue #4788. I'll include a link back to this there, too.

@Segmentational
Copy link
Author

Note -- this was ran on the latest LTS version of Node.js.

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

Successfully merging this pull request may close these issues.

2 participants