Precisely determine the file path of the calling JavaScript file with get-caller-file. This lightweight npm package offers a simple yet effective way to identify the source of a function call. Useful for logging, debugging, and dynamically resolving file paths relative to the caller. Unlike complex solutions, get-caller-file provides a direct, reliable result. It improves code clarity when distinguishing call origins matters in various package interactions.
The npm package get-caller-file saw initial releases (1.0.0, 1.0.1) in December 2015. Sporadic updates followed, with versions 1.0.2 (August 2016), 1.0.3 and 2.0.0 (July 2018) , and 2.0.1 (December 2018). A burst of releases (2.0.2, 2.0.3, 2.0.4, 2.0.5) occurred in March 2019. Since then, there have been no new versions published, with the latest data showing no releases up to August 2025.
get-caller-file downloads show strong growth from March 2024 to September 2025. Downloads increased from 158 million to 41.9 million. July 2025 saw nearly 300 million downloads but August downloads dropped, however, September exceeds all previous data. September will finish higher than all previous months.