Created
July 12, 2016 13:49
-
-
Save auchomage/e066ac4d5660b81ebfecc195bc084846 to your computer and use it in GitHub Desktop.
Using module.exports 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
// make data available to decon_t1_callingFile.js | |
module.exports = function(){ | |
console.log('Output from file decon_t1calledFile.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
// get input from file called 'decon_t1_calledFile.js' | |
var someInput = require('./decon_t1_calledFile.js'); | |
// display contents of someInput | |
someInput(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works