• Register

Share:- Whatsapp Facebook Facebook

------------------------------------- Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

Categories

0 votes
33 views
What require() is used in Node.js ?
in Node.js by

1 Answer

0 votes
require():- The require() method is used to include modules from external files in Node.js. It is the easiest way to include a module in Node.js. The require function takes a string parameter which contains the location of file that you want to include. It reads the entire javascript file, executes the file, and then proceeds to return the exports object.

Syntax:-
require('path');
by (4.4k points)
...