requirement will took you to invent. so if you know what your requirement then you will try to invent it.
a good programmer invent or write/hack a code one time but use again and again so today i will tell you how you create/hack a module one time for future requirement in node.js.
create a module in node.js is so easy no complication is here .
ok lets hack first of you need to create a folder "node_modules" if not exist.
in node have two keyword for package manage one "require" and another "exports" require for import a package from node module and another for export a module to app.
create a file like "new_module.js" file or anything and write your function in this file only follow bellow structure:
exports.function_name=function(){
//your code here
};
a good programmer invent or write/hack a code one time but use again and again so today i will tell you how you create/hack a module one time for future requirement in node.js.
create a module in node.js is so easy no complication is here .
ok lets hack first of you need to create a folder "node_modules" if not exist.
in node have two keyword for package manage one "require" and another "exports" require for import a package from node module and another for export a module to app.
create a file like "new_module.js" file or anything and write your function in this file only follow bellow structure:
exports.function_name=function(){
//your code here
};