The below is my node.js project structure. In the folder "lib" I have "Notification.js" file, in which I want to require the "index.js" file. If that index.js file is available within the lib folder, I can use var module=require(./index). But now it's not available outside of the lib folder.
MyProject
|
|
index.js
lib
|
|
Notification.js
You can use relative imports. In your Notification.js:
var module = require('../index');