{"_id":"@alloc/caller-path","_rev":"1-2ce879096c0c86727653cd056f3d2e09","name":"@alloc/caller-path","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"@alloc/caller-path","version":"3.0.0","description":"Get the path of the caller function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/aleclarson/caller-path.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["caller","calling","module","path","parent","callsites","callsite","stacktrace","stack","trace","function","file"],"dependencies":{"caller-callsite":"^4.1.0"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.25.3"},"gitHead":"987dc7351089d8f0d6eb30c1025956c60c4ccc1a","bugs":{"url":"https://github.com/aleclarson/caller-path/issues"},"homepage":"https://github.com/aleclarson/caller-path#readme","_id":"@alloc/caller-path@3.0.0","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-qV0UrDX+L+gf9sWAYPe7pHYE6iiGQkoGU+VNR37m1okQeTSYPvVpoj5Vb2MyBPaIACi+dk17ouw5/Pdup8z3YQ==","shasum":"46c0a6f9d32b8a3b7071b8bc7fcb73a72d2e6ab7","tarball":"https://registry.npmjs.org/@alloc/caller-path/-/caller-path-3.0.0.tgz","fileCount":5,"unpackedSize":5117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdzAqCRA9TVsSAnZWagAAcakP/21bJBPEzxZBvYefhiym\nxBqpsGwqj2mpu/UMc6dMJEABbH/B+EVyryvsTUC3Jlmm92BqnB6U/A4T9dvE\nVqJHr+owtZa8qNpe7pJfrr1ypXNNqy2wXcoROIo6zmfikGaR7FdDiVAwcIzS\nJEHCJfIELteBIsl1u7nzSzqcfx/owkaf851WyyHrHKRXqPuYteqqzd7lOJXL\nzl9Mez8blZ/3XOmQbYsnlZD1MViW19LfBSeSu8Ci5GQqFLeeu3bwSzYnb2jy\ntlFOTs+2BpTDCRganpgfbpkCeRhsRNCS/lYQ9fz1a/31CCSku4U8ZUHBfs/E\n/j4Ghwwq4AHEGc7b3j0cydXj+VYn3722ic1zo+QHWaSX/DfgZH8X6tNPwEoY\n1YplwuN2Fcys+kNcyl4KFrYfGM2xgfWQckzXDQeDjSiTCmZkQX2VOARYheEL\ndA1CotIvoU+xnjNTr6Y/rxrpakpcraBzpfLxi/gb20qK5KuiyQwkeaFLm295\nZkvkdZpYmMdLKa+WfE9tcO9pJ0FrCadeRhpdlXvmCMp4+c7Y5SKkE8eYSbjI\n4q5O9UEZR6okpf3KQ/Dk+7W8CsYAVFfKNqj3srKXXbe8pkxh2rmiIphpCZfj\niJxhLOQHE/vnIVizo0M7z7XrQlCWwm9QvXluqCDsgMQxmObeOv8+67mZ7oSl\nzhVM\r\n=NOgS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICPtyavmsvi81YzQAVd6cc3P5xkkV6Ey+JSuj8X86hIFAiEAt0HrveK7bpLTANqizgD9RuorzwxlH3aViPMXwjNPipc="}]},"_npmUser":{"name":"aleclarson","email":"aleclarson@protonmail.com"},"directories":{},"maintainers":[{"name":"aleclarson","email":"aleclarson@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caller-path_3.0.0_1618423850095_0.8684175171498485"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-14T18:10:49.933Z","3.0.0":"2021-04-14T18:10:50.300Z","modified":"2022-04-04T13:33:34.310Z"},"maintainers":[{"name":"aleclarson","email":"aleclarson@protonmail.com"}],"description":"Get the path of the caller function","homepage":"https://github.com/aleclarson/caller-path#readme","keywords":["caller","calling","module","path","parent","callsites","callsite","stacktrace","stack","trace","function","file"],"repository":{"type":"git","url":"git+https://github.com/aleclarson/caller-path.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"bugs":{"url":"https://github.com/aleclarson/caller-path/issues"},"license":"MIT","readme":"# caller-path\n\n> Get the path of the caller function\n\n**Important:** You have to use `'use strict';` in your code for this module to work correctly, or make sure the module is an ESM module, which is implicitly strict.\n\nFork that includes https://github.com/sindresorhus/caller-path/pull/9\n\n## Install\n\n```\n$ npm install caller-path\n```\n\n## Usage\n\n```js\n// foo.js\nconst callerPath = require('caller-path');\n\nmodule.exports = () => {\n\tconsole.log(callerPath());\n\t//=> '/Users/sindresorhus/dev/unicorn/bar.js'\n}\n```\n\n```js\n// bar.js\nconst foo = require('./foo');\nfoo();\n```\n\nIf the caller's [callsite](https://github.com/sindresorhus/callsites#api) object `getFileName` was not defined for some reason, it will return `undefined`.\n\n## API\n\n### callerPath(options?)\n\nGet the path of the caller function.\n\n##### depth\n\nType: `number`\\\nDefault: `0`\n\nThe caller path depth, meaning how many levels we follow back on the stack trace.\n\nFor example:\n\n```js\n// foo.js\nconst callerPath = require('caller-path');\n\nmodule.exports = () => {\n\tconsole.log(callerPath());\n\t//=> '/Users/sindresorhus/dev/unicorn/foobar.js'\n\tconsole.log(callerPath({depth: 1}));\n\t//=> '/Users/sindresorhus/dev/unicorn/bar.js'\n\tconsole.log(callerPath({depth: 2}));\n\t//=> '/Users/sindresorhus/dev/unicorn/foo.js'\n}\n```\n\n```js\n// bar.js\nconst foo = require('./foo');\n\nmodule.exports = () => {\n\tfoo();\n}\n```\n\n```js\n// foobar.js\nconst bar = require('./bar');\nbar();\n```\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-caller-path?utm_source=npm-caller-path&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","readmeFilename":"readme.md"}