-
-
Save mschultheiss83/b3564602d413f4d04049 to your computer and use it in GitHub Desktop.
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 myFunc = require("./myFunc"); | |
(function bar(){ | |
myFunc("bar message"); | |
})(); |
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 myFunc = require("./myFunc"); | |
(function foo(){ | |
myFunc("foo message"); | |
})(); |
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
function myFunc(arg){ | |
console.log(arg); | |
console.log(module.parent.filename); | |
// Here I need the file path of the caller function | |
// For example, "/path/to/foo.js" and "/path/to/bar.js" | |
} | |
module.exports = myFunc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment