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

Rename binary that supports ESM to node2 #42469

Open
Raynos opened this issue Mar 25, 2022 · 4 comments
Open

Rename binary that supports ESM to node2 #42469

Raynos opened this issue Mar 25, 2022 · 4 comments
Labels
esm feature request

Comments

@Raynos
Copy link
Contributor

@Raynos Raynos commented Mar 25, 2022

What is the problem this feature will solve?

I'm currently using nodejs with require and commonjs,

I cannot require an .js file that uses ESM and it's a terrible user experience.

What is the feature you are proposing to solve the problem?

Can we remove ESM support from node and make a node2 binary that supports ESM ?

What alternatives have you considered?

Add the ability to require an ESM module.

@Raynos Raynos added the feature request label Mar 25, 2022
@aduh95
Copy link
Contributor

@aduh95 aduh95 commented Mar 26, 2022

I'm not sure I understand the ask, even if we remove support for ESM and/or add a node2 binary, you still wouldn't be able to require an ESM file 🤔

@jasnell
Copy link
Member

@jasnell jasnell commented Mar 26, 2022

If I understand the ask, it's for ./node to only ever work with commonjs and for ./node2 to only ever work with ESM. It's a python2/python3 type split. If that is indeed the ask, strong -1.

@VoltrexMaster VoltrexMaster added the esm label Mar 26, 2022
@bnb
Copy link
Member

@bnb bnb commented Mar 27, 2022

It's a python2/python3 type split.

also strong -1 on this.

@benjamingr
Copy link
Member

@benjamingr benjamingr commented Mar 27, 2022

Is there an issue with passing a CLI flag to the node binary or adding a package.json with "type": "module"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm feature request
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants