Last active
December 10, 2015 23:19
-
-
Save viezel/4508849 to your computer and use it in GitHub Desktop.
CommonJS example
This file contains hidden or 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
//method 1: minklasse.js | |
function MinKlasse(args){ | |
function hejsa(){ | |
return 1; | |
} | |
return { | |
hejsa:function(){ | |
return 1; | |
} | |
} | |
} | |
module.exports = MinKlasse; | |
//method 2 | |
exports.hejsa = function(){ | |
return 1; | |
} | |
//Method 1: index.js | |
var MinKlasse = require("minklasse"); | |
minKlasse = new MinKlassse(args); | |
//Method 2: index.js | |
var MinKlasse = require("minklasse"); | |
MinKlasse.hejsa(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment