I have this global function in my main app file
async getTip(){
const tipschema = require('./schemas/tipschema')
const tipschemas = await tipschema.find()
const randomschema = tipschemas[Math.floor(Math.random()*tipschemas.length)]
const randomtip = randomschema.tip
return randomtip
},
Is there any way I can get the file name that is calling the function? For example:
async getTip(){
const file = await req.file // example of what I'm trying to do
},
thanks