This documentation focuses on explaining the uses and of the require()
statement that NodeJS includes in their language.
Require is an import of certain files or packages used with NodeJS's modules. It is used to improve code structure and uses. require()
is used on files that are installed locally, with a direct route from the file that is require
'ing.
testFile
testFile
have function testFunction
Using require()
allows code to be structured in a way similar to Java's use of classes and public methods. If a function is .export
'ed, it can be require
'ed in another file to be used. If a file is not .export
'ed, it cannot be used in another file.