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

Docs: Why say you likely want CommonJS? #1366

Closed
davidsk opened this issue Nov 23, 2020 · 2 comments
Closed

Docs: Why say you likely want CommonJS? #1366

davidsk opened this issue Nov 23, 2020 · 2 comments

Comments

@davidsk
Copy link

davidsk commented Nov 23, 2020

The docs say that You very likely want "CommonJS" but without any explanation. This was mentioned in #594 also.

It would be very helpful to know why CommonJS is assumed to be the preferred module format over the other options.

@orta orta changed the title Docs: Docs: Why say you likely want CommonJS? Dec 3, 2020
@orta
Copy link
Contributor

orta commented Dec 3, 2020

Cool, good feedback. I've changed it to "You very likely want "CommonJS" in node projects" which is generally the dominant way people use TypeScript. 👍🏻

@orta orta closed this as completed in 0258b86 Dec 3, 2020
@Sti2nd
Copy link
Contributor

Sti2nd commented Jul 14, 2021

Can I suggest thinking through this sentence again one year later? 😅 @orta (EDIT: linked a new issue, perhaps better to discuss there)

Now that all active Node versions support the EcmaScript module system it makes sense to encourage to use the standard; which ended up being ESM.

Some information on the state of EcmaScript module (ESM) support in the Node world: Node 10 didn't support ESM but reached end of life earlier this year, Node 12 supports ESM behind a flag, and from Node 14 ESM is considered a stable feature according to the docs.

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

No branches or pull requests

3 participants