-
-
Save cary205/a896459a6856be1c7d083b045b4e4dcf to your computer and use it in GitHub Desktop.
CommonJS module 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
| module.exports = function(number) { | |
| return number * 2; | |
| } |
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
| var doubleNumber = require("./double-number"); | |
| console.log(doubleNumber(4)); // 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment