From a9f61adcfb45a8f51421c61755f78d61dbee2655 Mon Sep 17 00:00:00 2001 From: Will Featherston <60191328+FitzHawke@users.noreply.github.com> Date: Sat, 24 Sep 2022 08:02:02 -0400 Subject: [PATCH] Javascript Roadmap Add module content (#1850) * Add contents to javascript modules subsection 100-commonjs * Add contents to javascript modules subsection 101-esm * Update content/roadmaps/106-javascript/content/115-javascript-modules/100-commonjs.md * Update content/roadmaps/106-javascript/content/115-javascript-modules/101-esm.md Co-authored-by: Kamran Ahmed --- .../content/115-javascript-modules/100-commonjs.md | 10 +++++++++- .../content/115-javascript-modules/101-esm.md | 11 ++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/content/roadmaps/106-javascript/content/115-javascript-modules/100-commonjs.md b/content/roadmaps/106-javascript/content/115-javascript-modules/100-commonjs.md index 0a991377e..0250eefaa 100644 --- a/content/roadmaps/106-javascript/content/115-javascript-modules/100-commonjs.md +++ b/content/roadmaps/106-javascript/content/115-javascript-modules/100-commonjs.md @@ -1 +1,9 @@ -# Commonjs \ No newline at end of file +# CommonJS + +CommonJS modules are the original way to package JavaScript code for Node.js. Node.js also supports the ESModules standard used by browsers and other JavaScript runtimes, but CJS is still widely used in backend Node.js applications. Sometimes these modules will be written with a .cjs extension. + +Free Content +Modules in Javascript: CJS Section +Node.js documentation for CJS modules +How the CJS Module System Works +How to Import and Export Modules in CJS \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/115-javascript-modules/101-esm.md b/content/roadmaps/106-javascript/content/115-javascript-modules/101-esm.md index a915a35c2..44880bced 100644 --- a/content/roadmaps/106-javascript/content/115-javascript-modules/101-esm.md +++ b/content/roadmaps/106-javascript/content/115-javascript-modules/101-esm.md @@ -1 +1,10 @@ -# Esm \ No newline at end of file +# ESModules + +ESModules is a standard that was introduced with ES6 (2015). The idea was to standardize how JS modules work and implement these features in browsers. This standard is widely used with frontend frameworks such as react and can also be used in the backend with Node.js. Sometimes these modules will be written with a .mjs extension. + +Free Content +Introduction to Modules in Javascript +Full ESM module overview from MDN +Full ESM module overview from js.info +Node.js documentation for ESModules +JavaScript ES6 Modules Simplified