I have file to export 'item-state-manager.js':
module.exports.aggregate_states = function (member_states) {
console.log(member_states);
}
other file should import this module and use function 'aggregate_states':
var aggregate_states = require("./item-state-manager.js")
module.exports.saveItem = function () {
var aggregate = aggregate_states("state");
}
But i receiving error:
TypeError: aggregate_states is not a function
Do I import 'item-state-manager.js' wrong?