{"name":"caller-callsite","version":"6.0.0","description":"Get the callsite of the caller function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/caller-callsite.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava"},"keywords":["caller","calling","module","parent","callsites","callsite","stacktrace","stack","trace","function","file"],"dependencies":{"callsites":"^4.2.0"},"devDependencies":{"ava":"^6.4.1","xo":"^1.2.2"},"_id":"caller-callsite@6.0.0","gitHead":"a8f4cb9cc73b9ce980d2306c06fa16f2519c1faa","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/caller-callsite/issues"},"homepage":"https://github.com/sindresorhus/caller-callsite#readme","_nodeVersion":"20.19.5","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Tsue2ZAagVmy/lSMhyfgnUEpp/w4Hqtc329qaVasjc7WpEfZr+rISGheR9lUhDyi14DGtIE+q+F6i5451afXtQ==","shasum":"7e510bd8d2ef3738333368bca8c63bef981b90ad","tarball":"http://registry-npm.ywwl.com/caller-callsite/download/caller-callsite-6.0.0.tgz","fileCount":5,"unpackedSize":5006,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDNL2JMvkx3CfOIiWIv7Bai74uxwIV1VA/lXd7eMeuDEgIgfaXHtiYMo4yvUzkir/FYADCKdmv4vLJWPVUhJP9iKXA="}],"size":2074,"noattachment":false,"key":"/caller-callsite/-/caller-callsite-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/caller-callsite_6.0.0_1758443254685_0.8742730803685035"},"_hasShrinkwrap":false,"readme":"# caller-callsite\n\n> Get the [callsite](https://github.com/sindresorhus/callsites#api) of the caller function\n\n## Install\n\n```sh\nnpm install caller-callsite\n```\n\n## Usage\n\n```js\n// foo.js\nimport callerCallsite from 'caller-callsite';\n\nexport default function foo() {\n\tconsole.log(callerCallsite().getFileName());\n\t//=> '/Users/sindresorhus/dev/unicorn/bar.js'\n}\n```\n\n```js\n// bar.js\nimport foo from './foo.js';\nfoo();\n```\n\n## API\n\n### callerCallsite(options?)\n\nReturns a [`callsite`](https://github.com/sindresorhus/callsites#api) object.\n\n#### options\n\nType: `object`\n\n##### depth\n\nType: `number`\\\nDefault: `0`\n\nThe callsite depth, meaning how many levels we follow back on the stack trace from the caller.\n\nFor example:\n\n```js\n// foo.js\nimport callerCallsite from 'caller-callsite';\n\nexport default function foo() {\n\tconsole.log(callerCallsite().getFileName());\n\t//=> '/Users/sindresorhus/dev/unicorn/bar.js'\n\tconsole.log(callerCallsite({depth: 1}).getFileName());\n\t//=> '/Users/sindresorhus/dev/unicorn/foobar.js'\n}\n```\n\n```js\n// bar.js\nimport foo from './foo.js';\n\nexport default function bar() {\n\tfoo();\n}\n```\n\n```js\n// foobar.js\nimport bar from './bar.js';\nbar();\n```\n","publish_time":1758443254891,"_cnpm_publish_time":1758443254891,"dist-tags":{"latest":"6.0.0"}}