Add node.js content (#1937)

Co-authored-by: Ankit <ankit@Ankits-MacBook-Air.local>
Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
pull/1935/head^2
Ankit D 2 years ago committed by GitHub
parent 0148a425c7
commit 9c8254f080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      content/roadmaps/107-nodejs/content/100-nodejs-introduction/101-why-nodejs.md
  2. 12
      content/roadmaps/107-nodejs/content/101-nodejs-modules/100-commonjs-vs-esm.md
  3. 8
      content/roadmaps/107-nodejs/content/101-nodejs-modules/102-global-keyword.md
  4. 10
      content/roadmaps/107-nodejs/content/101-nodejs-modules/readme.md
  5. 2
      content/roadmaps/107-nodejs/content/102-nodejs-npm/101-global-install-vs-local-install.md
  6. 5
      content/roadmaps/107-nodejs/content/102-nodejs-npm/102-updating-packages.md
  7. 6
      content/roadmaps/107-nodejs/content/104-nodejs-async-programming/103-async-await.md
  8. 8
      content/roadmaps/107-nodejs/content/104-nodejs-async-programming/readme.md
  9. 9
      content/roadmaps/107-nodejs/content/105-nodejs-working-with-files/100-fs-module.md
  10. 9
      content/roadmaps/107-nodejs/content/107-nodejs-apis/103-fastify.md
  11. 8
      content/roadmaps/107-nodejs/content/107-nodejs-apis/106-axios.md
  12. 2
      content/roadmaps/107-nodejs/content/107-nodejs-apis/108-jsonwebtoken.md
  13. 9
      content/roadmaps/107-nodejs/content/107-nodejs-apis/109-passport-js.md
  14. 2
      content/roadmaps/107-nodejs/content/111-nodejs-testing/101-mocha.md
  15. 8
      content/roadmaps/107-nodejs/content/111-nodejs-testing/102-cypress.md

@ -1,13 +1,9 @@
# Why Node.js # Why Node.js
* Node.js is OpenSource Node.js is a cross-platform runtime, perfect for a wide range of use cases. Its huge community makes it easy to get started. It uses the V8 engine to compile JavaScript and runs at lightning-fast speeds. Node.js applications are very scalable and maintainable. Cross-platform support allows the creation of all kinds of applications - desktop apps, software as a service, and even mobile applications. Node.js is perfect for data-intensive and real-time applications since it uses an event-driven, non-blocking I/O model, making it lightweight and efficient. With such a huge community, a vast collection of Node.js packages is available to simplify and boost development.
* Guarantees ease of scaling applications vertically by adding new resources to the existing node and horizontally with the addition of new nodes
* It facilitates building separate components that easily complement larger applications, which means saving money at the initial development stages and potentially shortening time-to-market, reusable code (some of the code can be used both on the front and backend)
* Tested on production (a lot of [companies use it](https://selleo.com/blog/10-successful-companies-using-nodejs) from the very beginning in 2009)
* offers improved performance thanks to Chrome’s V8 engine
* using JavaScript on both backend and frontend makes Node a great choice to improve speed and simplicity of implementation
<ResourceGroupTitle>Free Content</ResourceGroupTitle> <ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='blue' badgeText='Read' href='https://www.freecodecamp.org/news/what-are-the-advantages-of-node-js/'>Pros of Node.js</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://nodejs.dev/en/learn/'>Learn Node.js</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://nodejs.dev/en/learn/'>Learn Node.js</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://medium.com/selleo/why-choose-node-js-b0091ad6c3fc'>Why Choose Node.js?</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://medium.com/selleo/why-choose-node-js-b0091ad6c3fc'>Why Choose Node.js?</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.bitovi.com/blog/5-reasons-to-choose-nodejs'>5 Reasons to Choose Node.js</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.bitovi.com/blog/5-reasons-to-choose-nodejs'>5 Reasons to Choose Node.js</BadgeLink>

@ -1,10 +1,10 @@
# CommonJS vs ESM # CommonJS vs ESM
A module system allows us to split up our code in different parts or to include code written by other developers. CommonJS and ES (EcmaScript) are module systems used in Node. CommonJS is the default module system. However, a new module system was recently added to NodeJS - ES modules. CommonJS modules use the require() statement for module imports and module.exports for module exports while it's import and export for ES.
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.
<ResourceGroupTitle>Free Content</ResourceGroupTitle> <ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://blog.logrocket.com/commonjs-vs-es-modules-node-js/'>CommonJS vs ESM</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://blog.logrocket.com/commonjs-vs-es-modules-node-js/'>CommonJS vs. ES modules in Node.js</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.javascripttutorial.net/nodejs-tutorial/nodejs-modules/'>Using CommonJS</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://reflectoring.io/nodejs-modules-imports/'>CommonJS vs. ES Modules: Modules and Imports in NodeJS</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://blog.logrocket.com/es-modules-in-node-today/'>Using ES Modules</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=pP4kjXykbio'>Using Modules</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://reflectoring.io/nodejs-modules-imports/'>CommonJS vs. ES Modules: Modules and Imports in NodeJS</BadgeLink>

@ -1,6 +1,8 @@
# global Keyword # global keyword
In browsers, the top-level scope is the global scope. This means that within the browser var something will define a new global variable. In Node.js this is different. The top-level scope is not the global scope; `var something` inside a Node.js module will be local to that module. The global object gives access to some useful functions that can be used directly in our code. The global object, in contrast to the global object in a browser, is not the Window object. It is just an object called 'Global'.
<ResourceGroupTitle>Free Content</ResourceGroupTitle> <ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://nodejs.org/api/globals.html#global'>global Keyword in Node.js</BadgeLink> <BadgeLink colorScheme='blue' badgeText='Read' href='https://nodejs.org/api/globals.html'>Official Documentation</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=jn8PZNBmKm0'>What is Global Object?</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=PY-AycMkEAg'>Global Object in Node</BadgeLink>

@ -1,7 +1,9 @@
# Node.js Modules # Node.js modules
CommonJS modules are the original way to package JavaScript code for Node.js. Node.js also supports the ECMAScript modules standard used by browsers and other JavaScript runtimes, they are the official standard format to package JavaScript code for reuse. We split our code into different files to maintain, organize and reuse code whenever possible. A module system allows us to split and include code and import code written by other developers whenever required. In simple terms, a module is nothing but a JavaScript file. Node.js has many built-in modules that are part of the platform and comes with Node.js installation, for example, HTTP, fs, path, and more.
<ResourceGroupTitle>Free Content</ResourceGroupTitle> <ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://nodejs.org/api/modules.html#modules-commonjs-modules'>Modules: CommonJS modules</BadgeLink> <BadgeLink colorScheme='blue' badgeText='Read' href='https://nodejs.org/api/modules.html'>Official Documentation</BadgeLink>
href='https://blog.logrocket.com/commonjs-vs-es-modules-node-js/'>CommonJS vs. ES modules in Node.js</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/node-js-modules/'>More about modules</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.freecodecamp.org/news/modular-programming-nodejs-npm-modules/'>Using Modules</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=9Amxzvq5LY8&'>Modules in Node.js</BadgeLink>

@ -6,4 +6,4 @@ NodeJS and NPM allow two methods of installing dependencies/packages: Local and
<BadgeLink colorScheme='blue' badgeText='Official Website' href='https://docs.npmjs.com/downloading-and-installing-packages-locally'>Downloading and installing packages locally</BadgeLink> <BadgeLink colorScheme='blue' badgeText='Official Website' href='https://docs.npmjs.com/downloading-and-installing-packages-locally'>Downloading and installing packages locally</BadgeLink>
<BadgeLink colorScheme='blue' badgeText='Official Website' href='https://docs.npmjs.com/downloading-and-installing-packages-globally'>Downloading and installing packages globally</BadgeLink> <BadgeLink colorScheme='blue' badgeText='Official Website' href='https://docs.npmjs.com/downloading-and-installing-packages-globally'>Downloading and installing packages globally</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://docs.npmjs.com/cli/v8/commands/npm-install'>NPM Install Docs</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://docs.npmjs.com/cli/v8/commands/npm-install'>NPM Install Docs</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/what-is-global-installation-of-dependencies-in-node-js/'>What is global installation of dependencies in Node.js ?</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/what-is-global-installation-of-dependencies-in-node-js/'>What is global installation of dependencies in Node.js ?</BadgeLink>

@ -1,6 +1,9 @@
# Updating Packages # Updating Packages
Updating local and global packages you downloaded from the registry helps keep your code and tools stable, usable, and secure. npm provides various features to help install and maintain the project's dependencies. Dependencies get updates with new features and fixes, so upgrading to a newer version is recommended. We use npm update commands for this.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.freecodecamp.org/news/how-to-update-npm-dependencies/'>How to update?</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=Ghdfdq17JAY'>Updating dependencies</BadgeLink>
<ResourceGroupTitle>Free Content</ResourceGroupTitle> <ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://docs.npmjs.com/updating-packages-downloaded-from-the-registry'>Updating packages downloaded from the registry</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://docs.npmjs.com/updating-packages-downloaded-from-the-registry'>Updating packages downloaded from the registry</BadgeLink>

@ -1,8 +1,10 @@
# Async/Await # Async/Await
An async function is a function declared with the async keyword, and the await keyword is permitted within it. The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner style, avoiding the need to explicitly configure promise chains. Async/Await is a special syntax to work with promises in a more comfortable fashion. It's easy to understand and use. Adding the keyword async before a function ensures that the function returns a promise and the keyword await makes JavaScript wait until that promise settles and returns the result.
<ResourceGroupTitle>Free Content</ResourceGroupTitle> <ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function'>async/await mdn</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function'>Official Documentation</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://javascript.info/async-await'>More on async await</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=V_Kr9OSfDeU'>Using async await</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.w3docs.com/learn-javascript/async-await.html'>W3Docs Async/Await</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.w3docs.com/learn-javascript/async-await.html'>W3Docs Async/Await</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/difference-between-promise-and-async-await-in-node-js/'>Difference between Promise and Async/Await</BadgeLink> <BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/difference-between-promise-and-async-await-in-node-js/'>Difference between Promise and Async/Await</BadgeLink>

@ -1 +1,7 @@
# Nodejs async programming # Nodejs async programming
Asynchronous code means that things can happen independently of the main program flow, async functions in JavaScript are processed in the background without blocking other requests. It ensures non-blocking code execution. Asynchronous code executes without having any dependency and no order. This improves the system efficiency and throughput. Making web apps requires knowledge of asynchronous concepts since we will be dealing with actions that require some time to get processed.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink badgeText='Read' colorScheme="blue" href='https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Introducing/'>Introduction to Async JS</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=Kpn2ajSa92c'>Asynchronous Vs Synchronous Programming</BadgeLink>

@ -1 +1,8 @@
# Fs module # Fs module
File System or fs module is a built in module in Node that enables interacting with the file system using JavaScript. All file system operations have synchronous, callback, and promise-based forms, and are accessible using both CommonJS syntax and ES6 Modules.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='blue' badgeText='Read' href='https://nodejs.org/api/fs.html'>Official Documentation</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.w3schools.com/nodejs/nodejs_filesystem.asp'>More about fs module</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=ZySsdm576wE'>Using fs</BadgeLink>

@ -1 +1,8 @@
# Fastify # Fastify
Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture, inspired by Hapi and Express.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='blue' badgeText='Official Website' href='https://www.fastify.io/'>Fastify Website</BadgeLink>
<BadgeLink colorScheme='blue' badgeText='Official Documentation' href='https://www.fastify.io/docs/latest/'>Fastify Official Documentations</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=Lk-uVEVGxOA'>Beginner Fastify Tutorial</BadgeLink>

@ -1 +1,7 @@
# Axios # Axios
Axios is a promise-based HTTP Client for node.js and the browser. Used for making requests to web servers. On the server-side it uses the native node.js http module, while on the client (browser) it uses XMLHttpRequests.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='blue' badgeText='Official Documentation' href='https://axios-http.com/docs/intro'>Axios Official Documentations</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=6LyagkoRWYA'>Axios Tutorial</BadgeLink>

@ -4,3 +4,5 @@ JWT, or JSON-Web-Token, is an open standard for sharing security information bet
<ResourceGroupTitle>Free Content</ResourceGroupTitle> <ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink badgeText='Official Package' colorScheme="blue" href='https://www.npmjs.com/package/jsonwebtoken'>Package Documentation</BadgeLink> <BadgeLink badgeText='Official Package' colorScheme="blue" href='https://www.npmjs.com/package/jsonwebtoken'>Package Documentation</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.akana.com/blog/what-is-jwt'>What is JWT</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=mbsmsi7l3r4'>JWT Implementation</BadgeLink>

@ -1 +1,8 @@
# Passport js # Passport js
Passport.js is authentication middleware for Node.js. It makes implementing authetication in express apps really easy and fast. It is extremely flexible and modular. It uses "strategies" to support authentication using a username and password, Facebook, Twitter, and a lot of other sites.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='blue' badgeText='Official Website' href='https://www.passportjs.org/'>PassportJS Website</BadgeLink>
<BadgeLink colorScheme='blue' badgeText='Official Documentation' href='https://www.passportjs.org/docs/'>PassportJS Official Documentation</BadgeLink>
<BadgeLink badgeText='Watch' href='https://www.youtube.com/watch?v=sakQbeRjgwg&list=PL4cUxeGkcC9jdm7QX143aMLAqyM-jTZ2x'>Implemetaion of OAuth using passportjs</BadgeLink>

@ -5,4 +5,4 @@ Mocha is an open source JavaScript test framework running on Nodejs and in the b
<ResourceGroupTitle>Free Content</ResourceGroupTitle> <ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink badgeText='Website' colorScheme="yellow" href='https://www.npmjs.com/package/mocha'>Official Website</BadgeLink> <BadgeLink badgeText='Website' colorScheme="yellow" href='https://www.npmjs.com/package/mocha'>Official Website</BadgeLink>
<BadgeLink badgeText='Documentation' colorScheme="yellow" href='https://mochajs.org/'>Mocha Documentation</BadgeLink> <BadgeLink badgeText='Documentation' colorScheme="yellow" href='https://mochajs.org/'>Mocha Documentation</BadgeLink>
<BadgeLink badgeText='Youtube playlist' colorScheme="red" href='https://youtube.com/playlist?list=PLgbtO1Bcz4C-vU0JLfDBsZGbSUdNX4mQ8'>Mocha Tutorial</BadgeLink> <BadgeLink badgeText='Youtube playlist' colorScheme="red" href='https://youtube.com/playlist?list=PLgbtO1Bcz4C-vU0JLfDBsZGbSUdNX4mQ8'>Mocha Tutorial</BadgeLink>

@ -1 +1,7 @@
# Cypress # Cypress
Cypress is a new front end testing tool built for the modern web. It enables you to write faster, easier and more reliable tests.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink badgeText='Official Website' colorScheme='blue' href='https://www.cypress.io/'>Cypress Website</BadgeLink>
<BadgeLink badgeText='Documentation' colorScheme='blue' href='https://docs.cypress.io/'>Cypress Documentation</BadgeLink>

Loading…
Cancel
Save