sindresorhus / callsites

Get callsites from the V8 stack trace API
MIT License
260 stars 22 forks source link

callsites

Get callsites from the V8 stack trace API

Install

npm install callsites

Usage

import callsites from 'callsites';

function unicorn() {
    console.log(callsites()[0].getFileName());
    //=> '/Users/sindresorhus/dev/callsites/test.js'
}

unicorn();

API

Returns an array of callsite objects with the following methods: