Zadeklaruj wiele modułów.exports w Node.js
Staram się stworzyć jeden moduł zawierający wiele funkcji.
module.js:
module.exports = function(firstParam) { console.log("You did it"); },
module.exports = function(secondParam) { console.log("Yes you did it"); },
// This may contain more functions
main.js:
var foo = require('module.js')(firstParam);
var bar = require('module.js')(secondParam);
Mam problem z tym, żefirstParam
jest typem obiektu isecondParam
jest ciągiem URL, ale kiedy mam, zawsze narzeka, że typ jest błędny.
W jaki sposób mogę zadeklarować eksport wielu modułów w tym przypadku?