I have a nodejs export like this
exports.add = function(req){
var newUser = new User({
email: req.body.email,
password: req.body.password,
});
// Attempt to save the user
newUser.save(function(err) {
if (err) {
return true;
}
return false;
});
}
But it's giving as undefined when i call the function like this
var value = instance.add(req);
Here instance is the imported instance of the javascript file