In Node.js, I'm trying to obtain the name of current function being executed:
function doSomething(req, res) {
console.log('Function name: ' + doSomething.name);
}
This works well, but I'd like (if possible) to obtain the name within the current context. This way, if I renamed the method later I don't have change it manually. Is there a generic object (i.e. similar to 'this') that points to the current function being executed/current context? Thank you.