als-called-from
v1.0.0
Published
A utility module for Node.js that helps developers determine the file path from which a function was called, aiding in debugging and logging.
Downloads
58
Maintainers
Readme
als-called-from
Description
als-called-from
is a utility module designed to help developers trace the file paths from which functions were called.
Installation
Install als-called-from
via npm:
npm install als-called-from
Usage
To retrieve the path of the file from which a function was called, simply import als-called-from
and call it within your function:
const calledFrom = require('als-called-from');
const fileCalledFrom = calledFrom()
This example demonstrates how to use als-called-from
to identify the origin of function calls, which can be particularly handy in large projects or libraries.