reading-notes


Project maintained by Razan-am Hosted on GitHub Pages — Theme by mattgraham

Node JS Tutorial for Beginners #6 - Modules and require()

What is a module?

What does the word requiredo?

How do we bring another module into the file the we are working in?

What do we have to do to make a module available?

Example: module.exports=module_name

  • Then we declare it as avariable in the file we want it to be used in, in the reqiure section

Example:

`let function_name = require (‘./the name of the function’)


References:

@By The Net Ninja /Node JS Tutorial for Beginners #6 - Modules and require()