The example code is:
in main
square(width,function (data)
{
console.log(data.squareVal);
});
using the following may works
exports.square = function(width,callback)
{
var aa = new Object();
callback(aa.squareVal = width * width);
}