Created
January 21, 2014 16:21
-
-
Save johnhunter/8543148 to your computer and use it in GitHub Desktop.
Simple node require example
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
/* jshint node:true, es3:false */ | |
// we need some complex maths functions :) | |
var maths = require('./maths'); | |
console.log(maths.XplusY(2, 4)); | |
console.log(maths.XtimesY(2, 4)); |
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
/* jshint node:true, es3:false */ | |
// the maths module handles all your complex calulations | |
exports.XplusY = function(x, y){ | |
return x + y; | |
}; | |
exports.XtimesY = function(x, y){ | |
return x * y; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment