Created
March 31, 2017 20:57
-
-
Save adamkiss/c82fd46a87c2169312231c638c997e50 to your computer and use it in GitHub Desktop.
Require fresh module each time (as a function in lib.js)
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
'use strict' | |
module.exports = { | |
require_fresh: function (file) { | |
delete require.cache[require.resolve(file)] | |
return require(file) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment