Possible Duplicate:
Node.js – require empty path
What does require('../') mean in the context of node.js? Example code here.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A folder can be used as a module if the folder contains any of the following files (in lookup order):
package.json,index.js, orindex.node.In this case, the folder has a
package.jsonfile that, among some other things, states that the main file of the module is theindex.jsfile in the same directory. So therequire('../')call you asked about could be changed torequire('../index.js').See Node.js Documentation – Folders as Modules for more information.