If I simply copy/paste the new code at the end of the existing code, it breaks the previous instructions. I think it's better (easier) for me to add this new code to the existing code, as I don't know enough yet to create Submodules.
Multiple assignations to the module.exports variable won't work, you need to modify the functions defined in this object (oscInFilter, oscOutFilter, etc) so that all the desired instructions are followed. There is no automatic merging procedure but its possible to write a custom module that does it:
var submodules = [
require('./custom_modA.js'),
require('./custom_modB.js'),
// etc
]
module.exports = {
init: function(){
for (var m of submodules) {
if (m.init) m.init()
}
},
unload: function(){
for (var m of submodules) {
if (m.unload) m.unload()
}
},
oscInFilter: function(data){
for (var m of submodules) {
if (m.oscInFilter) data = m.oscInFilter(data)
if (!data) return
}
return data
},
oscOutFilter: function(data){
for (var m of submodules) {
if (m.oscOutFilter) data = m.oscOutFilter(data)
if (!data) return
}
return data
}
}