{"name":"caller-callsite","version":"4.0.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":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"37b1b9b108c5f010f71c0529002fbaf296627b3e","bugs":{"url":"https://github.com/sindresorhus/caller-callsite/issues"},"homepage":"https://github.com/sindresorhus/caller-callsite#readme","_id":"caller-callsite@4.0.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-ZASXM0oX5XUaYErf39VMD2vxy49k2OR5YxMnqiLicyw6Rr3FeL8zzjBdqT5GlxRNwOcLDNVZ6+VbVeG1Ekx88Q==","shasum":"5e0a91e685a450fb311488dfee6a7f754ac1e8ed","tarball":"http://registry-npm.ywwl.com/caller-callsite/download/caller-callsite-4.0.0.tgz","fileCount":5,"unpackedSize":3376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcy7X/CRA9TVsSAnZWagAAfL4P/j+JELrFtArgz6+5WYN1\nuQ3vTH79Htm7OyGDPA5ZcWFsYYb2La1qMDyHpZkJVXzU/olMDDlh8vVdzERy\nvC5N1O4pKgxcIguey6iKg5WXdCS78KXdqz5dxZOzx5Sx235TC1/Ec8C9NGiW\ngTqGeus2/WigxFcE631tvQMqUKxYtYvr2I5oqGqd0xPwi+A6xbZBPQvQxkNF\nwJIGsz0yaVkShfIL07Qx0uwdfUZa6Brmu8Cm/0AxuK8g47K7FO8U0T9CLab2\n6sf1+By9V4ZhQxlHqPeVqXrGZ7SY53oIMyf6iSjnz0KRZesbIWH56CM2pkeh\nS4WNvKJftXY7t5p27l+qu6yycYjgI9js0RtInaH0bRiz05ESzQh75a95eI2A\nBt1x4zIxJZILyssGdrijMc8GSUlzIewL3ocrvniH9IroJFJiA3EmaapBjJGC\nXCM+UIxkI8//xkEMicLbhfBrRz5kHc5NyMTwZQxwP1rFD2DZT6AxJ7TkrRLk\npcHgpMgJwSppmBz4gL/n39cIpwVxTjYCPr9xL5RfhZqxXv53Y0TUtkpBUmyR\nxyVjBE8yEafZl9OzIoO9AmLU/q7BHmObRIcFZhiyOeDp7kS0DMDBfz71uCbI\nBXTHyf+1Gvy+E7MOoVbz4jjMCevsTL8R3ktCDDvmLR95Uxhaa2/MZc7xirF5\n4fdp\r\n=Qoy/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdXu/vctjtvQg+FfNe8NwRp/Jwm2gw9hOc8sE25H28FAiEA5FirP04nYbASqAc109BF+K3FvG5qI3wsi0fBbMxbKKI="}],"size":1742,"noattachment":false,"key":"/caller-callsite/-/caller-callsite-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caller-callsite_4.0.0_1556854270743_0.9746273336361679"},"_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":1556854270949,"_cnpm_publish_time":1556854270949,"dist-tags":{"latest":"6.0.0"}}