How to Import Modules in Node JS, Exporting Modules in Node JS, Use Modules with Require, Codecademy

In this JavaScript programming walkthrough we look at How to Import Modules in Node JS, Exporting Modules in Node JS, Use Modules with Require, Codecademy. This lesson is based on the Codecademy “Learn Intermediate JavaScript” course, section “Modules”, lesson, “Implementing Modules in Node”. Throughout the lesson, we learn about modules in programming. We learn that the word modules, and files, are usually used interchangeably. We are told that modules are used to separate our code and make it easier to read and debug. We learn that modules help us separate our concerns as we are building out applications. While in the past, all our code was usually written within one file, now we are able to separate our code into their own files that make sense, and then we can import or export our modules to be used in other places. This is extremely helpful, and learning how to write modular clean code is based on knowing how to create modules that can easily be exported and imported to be used in other parts of our code. We learn that we are able to do this using modules.export, as well as the, require keyword. In this example, we practice creating modules in Node JS. It is recommended that you have a text editor installed (I use Atom in my example) and Node JS so that you may practice the examples shown. Once you are comfortable creating modules continue on and thanks for watching Implementing Modules in Node