Created
May 21, 2019 02:17
-
-
Save kohendrix/bc3bf24b91102f99974b657c2139f403 to your computer and use it in GitHub Desktop.
require when needed expample
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
function get() { | |
// check the db or something | |
const User = require('./user'); | |
return new User('John', 'johndoe@somemail.com'); | |
} | |
exports.getUser = get; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment