Sha256: 38161ec99b2cf36a4b33831b30935b99bdb180f6ab446a4f51c64d8aaf6d65ec
Contents?: true
Size: 744 Bytes
Versions: 26
Compression:
Stored size: 744 Bytes
Contents
# caller-callsite [![Build Status](https://travis-ci.org/sindresorhus/caller-callsite.svg?branch=master)](https://travis-ci.org/sindresorhus/caller-callsite) > Get the [callsite](https://github.com/sindresorhus/callsites#api) of the caller function ## Install ``` $ npm install --save caller-callsite ``` ## Usage ```js // foo.js const callerCallsite = require('caller-callsite'); module.exports = () => { console.log(callerCallsite().getFileName()); //=> '/Users/sindresorhus/dev/unicorn/bar.js' } ``` ```js // bar.js const foo = require('./foo'); foo(); ``` ## API ### callerCallsite() Returns a [`callsite`](https://github.com/sindresorhus/callsites#api) object. ## License MIT © [Sindre Sorhus](https://sindresorhus.com)
Version data entries
26 entries across 25 versions & 8 rubygems