Get the calling file and line number for logging in NodeJS
npm install whocalled
OR
yarn add whocalled
You can pretty much use this anywhere. It was designed with console logging in mind though.
const whoCalled = require('./index');
console.log(whoCalled(), 'Testing');
Feel free to submit issues and/or PRs! In lieu of a formal style guide, please follow existing styles.
MIT