{"name":"caller-callsite","version":"4.1.0","description":"Get the callsite of the caller function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/caller-callsite.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["caller","calling","module","parent","callsites","callsite","stacktrace","stack","trace","function","file"],"dependencies":{"callsites":"^3.1.0"},"devDependencies":{"ava":"^2.2.0","tsd":"^0.7.4","xo":"^0.24.0"},"gitHead":"6e7da58bf17f9deed697326f9ef3cf8fac4d801a","bugs":{"url":"https://github.com/sindresorhus/caller-callsite/issues"},"homepage":"https://github.com/sindresorhus/caller-callsite#readme","_id":"caller-callsite@4.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-99nnnGlJexTc41xwQTr+mWl15OI5PPczUJzM4YRE7QjkefMKCXGa5gfQjCOuVrD+1TjI/fevIDHg2nz3iYN5Ig==","shasum":"3e33cb1d910e7b09332d59a3503b9af7462f7295","tarball":"http://registry-npm.ywwl.com/caller-callsite/download/caller-callsite-4.1.0.tgz","fileCount":5,"unpackedSize":5026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJG92CRA9TVsSAnZWagAAqqAP/1XlMfI30yCbJLtDBfUd\n6e3/ZdJnIYgARv43Qe0haRQy8kWRFpymUkVT1xuBTGlaaoL4kkeblmZ9lkpC\nTChK1yDxK1Iern5auEgiqrDXDayPFAIbd3gzbr5teGqnCc1qXm2p57A9WXO+\n+64sVNvzUdSMjGr0dZdDSQyzZflJsZKPI59aj0JqSSEWAlPEAd827omab360\nfZqec/ZNOmIcWQW48UID1EMXa1iIuqHbhK/sTa/xWarHL6zRmzkQszKZ92JO\nycGM0I4W3El/23H24+FebTC77KjSaRMP7J7K8saSnsN1cquXVio2qbacaPl5\nZdtE/veKgR4fEzu28gJCsBaFm23Ar+p3c3XnCD/jmDbOQFHQwDanei55FT2G\nE4MA2kVUp1IhAdPlh75rOKk3Z59jXHXJGCZQOV5yK9zVJ+JPmPrHyy8RJAar\naCXu0GwFqNRkUVDgZ/nFIL2orAG3lExi3CZx+9O1zkq9WmpsAjmWHKi6dPE+\n77It20oEuNigp1/bHa0BTlCnf8d2Q/723NPZdfIa21yxibkfXB1uKER/xiKk\nmrYpx+Zfo2FjPxSl6K5xMWu47DBAl8yI6/oVmJqOH6cokuoOkHWXsHnVhodu\nT8gIaVRB5SVB5EWKtHZK9S/IQ8OPSvbtrkFDBAkpr0YXwyOpsQYkhXLUgo1R\nytx3\r\n=oLul\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBL0KfPmLZPjvNmg/myaBUvehJoKL2i/1ypcwnORxOLeAiAmfiJONPteZ5YwkzBteqRD7zwYBu/CVLlHKQhjzqnM4A=="}],"size":2058,"noattachment":false,"key":"/caller-callsite/-/caller-callsite-4.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caller-callsite_4.1.0_1562668917443_0.6392308800701345"},"_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.\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","publish_time":1562668917587,"_cnpm_publish_time":1562668917587,"dist-tags":{"latest":"6.0.0"}}