Skip to content

Instantly share code, notes, and snippets.

@johnhunter
Created January 21, 2014 16:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnhunter/8543148 to your computer and use it in GitHub Desktop.
Save johnhunter/8543148 to your computer and use it in GitHub Desktop.
Simple node require example
/* 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));
/* 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