{"_id":"@cjser/caller-callsite","name":"@cjser/caller-callsite","dist-tags":{"latest":"6.0.0-cjser.2"},"versions":{"6.0.0-cjser.2":{"name":"@cjser/caller-callsite","version":"6.0.0-cjser.2","description":"Get the callsite of the caller function","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.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","require":"./dist-cjser/index.cjs","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":{"@cjser/callsites":"4.2.0-cjser.2"},"devDependencies":{"ava":"^6.4.1","xo":"^1.2.2"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"6.0.0","cjserVersion":2,"original":{"name":"caller-callsite","version":"6.0.0","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/caller-callsite","dependencies":{"callsites":"^4.2.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava"}}},"_id":"@cjser/caller-callsite@6.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-lr9jOdMLHFxJPYwf/vu7xLMDf+d5gBEaWC25k8Gsjk/wFqoH3a10YCQNOyEgbYCQHR5EB19bvHnpAEEn7b5eOw==","shasum":"72dad0aef9bb01bc2feafb3299a13133318ea27e","tarball":"https://registry.npmjs.org/@cjser/caller-callsite/-/caller-callsite-6.0.0-cjser.2.tgz","fileCount":6,"unpackedSize":8123,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDiwQjbKphtcnnvx6oCU1q2fCnoBRzJDpLk7IVZFMxyvgIgBQcZDuhgff4shbzTZ1U7InPxqRNWhbjit2c6O+yiYkM="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/caller-callsite_6.0.0-cjser.2_1778157586018_0.037930993923788625"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T12:39:45.957Z","6.0.0-cjser.2":"2026-05-07T12:39:46.156Z","modified":"2026-05-07T12:39:46.318Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Get the callsite of the caller function","keywords":["caller","calling","module","parent","callsites","callsite","stacktrace","stack","trace","function","file"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/caller-callsite\n","readmeFilename":"readme.md","_rev":"1-0ba9ba097816cfea775ce426cb3c060b"}