-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Update introduction-to-nodejs.md #8518
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
base: main
Are you sure you want to change the base?
Conversation
Adding info about some terms that aren't explained anywhere in this intro tutorial page. Feel free to modify as desired--I just want this page to explain what CJS, ESM, and .mjs mean before using those terms. Signed-off-by: Jed Hartman <logos-github@kith.org>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website Please review the changes when you have a chance. Thank you! 🙏 |
| ## An Example Node.js Application | ||
|
|
||
| The most common example Hello World of Node.js is a web server: | ||
| The most common example Hello World of Node.js is a web server. You can choose between two versions of this example: one using the CommonJS (CJS) module system, using the filename extension `.js` or `.cjs`, and another using the ES Modules (ESM) system, using the filename extension `.mjs`. For more information, see [Understanding MJS and CJS](https://rgbstudios.org/blog/modules-explained-mjs-cjs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. I'd prefer if we linked to Node.js documentation (maybe something like https://nodejs.org/api/esm.html#modules-ecmascript-modules ) or MDN for explanations of the module systems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, .js can be both ESM or CJS
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8518 +/- ##
==========================================
+ Coverage 74.70% 74.72% +0.01%
==========================================
Files 102 102
Lines 8956 8956
Branches 305 305
==========================================
+ Hits 6691 6692 +1
+ Misses 2263 2262 -1
Partials 2 2 ☔ View full report in Codecov by Sentry. |
Adding info about some terms that aren't explained anywhere in this intro tutorial page. Feel free to modify as desired--I just want this page to explain what CJS, ESM, and .mjs mean before using those terms.
Description
Adding info about some terms that aren't explained anywhere in this intro tutorial page.
Validation
Just adding some text.
Related Issues
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.