{"_id":"@cjser/caller-callsite__v5_0_0","name":"@cjser/caller-callsite__v5_0_0","dist-tags":{"latest":"5.0.0-cjser.2"},"versions":{"5.0.0-cjser.2":{"name":"@cjser/caller-callsite__v5_0_0","version":"5.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":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["caller","calling","module","parent","callsites","callsite","stacktrace","stack","trace","function","file"],"dependencies":{"@cjser/callsites":"4.2.0-cjser.2"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","typescript":"^4.4.3","xo":"^0.45.0"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"5.0.0","cjserVersion":2,"original":{"name":"caller-callsite","version":"5.0.0","exports":"./index.js","repository":"sindresorhus/caller-callsite","dependencies":{"callsites":"^4.0.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/caller-callsite__v5_0_0@5.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-ysNIS/3m7wT/2rk1gnBnhpmRkCuQDZKmxryRsgW1FHFFtpzKywLkwqQ+1TGZjMkb3xqVTRQYuS5OA70BqJ56Lw==","shasum":"a03d38a141bf3dce3372fb9b6a0c3da86fbf5fbf","tarball":"https://registry.npmjs.org/@cjser/caller-callsite__v5_0_0/-/caller-callsite__v5_0_0-5.0.0-cjser.2.tgz","fileCount":6,"unpackedSize":8578,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDuGq1Mmrng8F74EVVPpl4m4P9vQ/R0X+QuLPv/AWF7BgIgR9VJdSHGgo+mDTY2Uode7JVbbsaOQrQBuFN7MNDdzbA="}]},"_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__v5_0_0_5.0.0-cjser.2_1778157590962_0.2744872971201249"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T12:39:50.851Z","5.0.0-cjser.2":"2026-05-07T12:39:51.114Z","modified":"2026-05-07T12:39:52.090Z"},"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.\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/foobar.js'\n\tconsole.log(callerCallsite({depth: 1}).getFileName());\n\t//=> '/Users/sindresorhus/dev/unicorn/bar.js'\n\tconsole.log(callerCallsite({depth: 2}).getFileName());\n\t//=> '/Users/sindresorhus/dev/unicorn/foo.js'\n}\n```\n\n```js\n// bar.js\nimport foo from './foo.js';\n\nexport default function foo() {\n\tfoo();\n}\n```\n\n```js\n// foobar.js\nimport bar from './bar.js';\nbar();\n```\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-caller-callsite?utm_source=npm-caller-callsite&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\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-f72fb1010ff2dad6f6faeac4f4b385ad"}