Created
August 16, 2011 16:08
-
-
Save saturngod/1149438 to your computer and use it in GitHub Desktop.
sample module in node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.division=function(num1,num2,callback) { | |
if(num2 <=0 ) { | |
callback("num2 shouldn't be less than or equal zero"); | |
} | |
callback (null,num1/num2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var div = require("./div.js"); | |
div.division(8,2,function(err,result){ | |
if(err==null) { | |
console.log(result); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment