From e936bf539208fddd4663ff4a5efef81f74781f82 Mon Sep 17 00:00:00 2001 From: Himanshu Aggarwal <94754091+himanshuaggar@users.noreply.github.com> Date: Wed, 5 Oct 2022 05:15:19 +0530 Subject: [PATCH] added content (#1968) Co-authored-by: Kamran Ahmed --- .../content/101-nodejs-modules/100-commonjs-vs-esm.md | 8 +++++--- .../102-nodejs-npm/101-global-install-vs-local-install.md | 8 ++++---- .../104-environment-variables/readme.md | 6 +++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/content/roadmaps/107-nodejs/content/101-nodejs-modules/100-commonjs-vs-esm.md b/content/roadmaps/107-nodejs/content/101-nodejs-modules/100-commonjs-vs-esm.md index 5197b0bbf..8199c081a 100644 --- a/content/roadmaps/107-nodejs/content/101-nodejs-modules/100-commonjs-vs-esm.md +++ b/content/roadmaps/107-nodejs/content/101-nodejs-modules/100-commonjs-vs-esm.md @@ -1,8 +1,10 @@ # CommonJS vs ESM -The CommonJS module system, on the other hand, is built into Node.js. Before the introduction of the ES module in Node.js, CommonJS was the standard for Node.js modules. As a result, many Node.js libraries and modules are written with CommonJS. +A module system allows us to split up our code in different parts or to include code written by other developers. -The ES module format was created to standardize the JavaScript module system. It has become the standard format for encapsulating JavaScript code for reuse. +Since the very beginning of NodeJS, the CommonJS module system is the default module system within the ecosystem. However, recently a new module system was added to NodeJS - ES modules. Free Content -CommonJS vs ESM \ No newline at end of file + +CommonJS vs. ES modules in Node.js +CommonJS vs. ES Modules: Modules and Imports in NodeJS \ No newline at end of file diff --git a/content/roadmaps/107-nodejs/content/102-nodejs-npm/101-global-install-vs-local-install.md b/content/roadmaps/107-nodejs/content/102-nodejs-npm/101-global-install-vs-local-install.md index e3b435a9c..c4876b4bf 100644 --- a/content/roadmaps/107-nodejs/content/102-nodejs-npm/101-global-install-vs-local-install.md +++ b/content/roadmaps/107-nodejs/content/102-nodejs-npm/101-global-install-vs-local-install.md @@ -1,9 +1,9 @@ # Global Install vs Local Install -NodeJS and NPM allow two methods of installing dependencies/packages: Local and Global. This is mainly used when adding a package or dependency as part of a specific project you're working on. The package would be installed (with its dependencies) in `node_modules` folder **under your project**. In addition, in `package.json` file there will be a new line added for the installed dependency under the label `dependencies`. -At this point - you can start using the package in your NodeJS code by importing the package. - -Unlike the local install, you can install packages and dependencies **globally**. This would install it in a system path, and these packages would be available to any program which runs on **this specific** computer. This method is often used for installing command line tools (for example, even `npm` program is a Globally installed npm package). +NodeJS and NPM allow two methods of installing dependencies/packages: Local and Global. This is mainly used when adding a package or dependency as part of a specific project you're working on. The package would be installed (with its dependencies) in `node_modules` folder **under your project**. In addition, in `package.json` file there will be a new line added for the installed dependency under the label `dependencies`. At this point - you can start using the package in your NodeJS code by importing the package. Unlike the local install, you can install packages and dependencies **globally**. This would install it in a system path, and these packages would be available to any program which runs on **this specific** computer. This method is often used for installing command line tools (for example, even `npm` program is a Globally installed npm package). Free Content +Downloading and installing packages locally +Downloading and installing packages globally NPM Install Docs +What is global installation of dependencies in Node.js ? diff --git a/content/roadmaps/107-nodejs/content/106-nodejs-command-line-apps/104-environment-variables/readme.md b/content/roadmaps/107-nodejs/content/106-nodejs-command-line-apps/104-environment-variables/readme.md index 4f958fbd4..0a1d359e0 100644 --- a/content/roadmaps/107-nodejs/content/106-nodejs-command-line-apps/104-environment-variables/readme.md +++ b/content/roadmaps/107-nodejs/content/106-nodejs-command-line-apps/104-environment-variables/readme.md @@ -1 +1,5 @@ -# Environment variables \ No newline at end of file +# Environment variables + +Reading Environment Variables From Node.js +Working With Environment Variables in Node.js + \ No newline at end of file