07-21-2023, 12:16 PM
It worked with me like the following....
**Lib1.js**
//Any other private code here
// Code you want to export
exports.function1 = function(params) {.......};
exports.function2 = function(params) {.......};
// Again any private code
now in the **Main.js** file you need to include *Lib1.js*
var mylib = requires('lib1.js');
mylib.function1(params);
mylib.function2(params);
Please remember to put the Lib1.js in **node_modules folder**.
**Lib1.js**
//Any other private code here
// Code you want to export
exports.function1 = function(params) {.......};
exports.function2 = function(params) {.......};
// Again any private code
now in the **Main.js** file you need to include *Lib1.js*
var mylib = requires('lib1.js');
mylib.function1(params);
mylib.function2(params);
Please remember to put the Lib1.js in **node_modules folder**.