{"name":"caller-callsite","version":"3.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":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["caller","calling","module","parent","callsites","callsite","stacktrace","stack","trace","function","file"],"dependencies":{"callsites":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"a1e1ac9d97b097a9d39237dfb48f637cafac7c3f","bugs":{"url":"https://github.com/sindresorhus/caller-callsite/issues"},"homepage":"https://github.com/sindresorhus/caller-callsite#readme","_id":"caller-callsite@3.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-/KKfFS+O210sONxwadGBiWa0SlKBOh0QcAkEpSExSw+3exLnZTOBCDsNobA+K72SZ7/U6OQfx3PXIWlJ02t0XQ==","shasum":"098183c36281310694b82c6be1ffd399211af017","tarball":"http://registry-npm.ywwl.com/caller-callsite/download/caller-callsite-3.0.0.tgz","fileCount":4,"unpackedSize":2752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCE5DCRA9TVsSAnZWagAAKdAQAJGoGs2aAk6XQoj52vyl\n8n/AYe9kaTO5dQVFAmwceozz2o566FJ9Js8H7rcA4+4ViJxzc1nntwNEkrNh\nA1XlsAzoaR5araGY95KY63WVstb5vnNPbpmt3VjbdEpABZPCPNGiFC9hhzJ/\nU18MxgEx9zsqjE6GLZCqQFdfv6OqwEHpX4IpkrqcyVH0mAAWUuwZL1ggucmh\n/f7NaSKYhADp7EWqKqKkSGyvvC9sAyhb6fEK2bl+fbQsHvsjtWY5vtfx5LIY\nOVb1A7TeyzjDx9MxHvC71wQpN9jCmJ9y+qYkDo2VZvFYxOB+cXgUXP/Oc5xB\nsU0Ms/E1NRCK1YgATqbQPbyky+pxbJYGBMqShFKkxtAVukHmVjF4pOHLEzG5\nKB7+bKqotwj9obiu14k6rSMxrgGdszLnq5b+CYF0wJ4qKHKotgJ8lVFOt3Wp\ntfD5o7yQv4fc9Oyrkv/zchP/5wOKN6JWyh7Pgon900eO8O/A3lDyP9niEMML\nNYtdKN/qh6iyQFU7FisZlpyhMjaj5CxuTQr5Dsug+xBJkYYhe44/pFi0Gbkc\nsJGWBX5u9zgFW4NvDoQr1krQ5WkmSXAt3uQHlUv4qVYNqR7NANJ2IYHa8Wf9\nvM5guFVYdn5jDZSJM1vCcsJxRYcEqkkFmqgTeCrHFRSPOC3FlYQGNt3UXTbk\n8WZb\r\n=1ZiU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFc02Fg4c7ALrgEjBFOzO1aYb8Fa8NZVhnw94/+A0v9gIhAN1GkbrABqRt6LeROJD7iOh5cEnRdKhpYY0qHMVElOg2"}],"size":1538,"noattachment":false,"key":"/caller-callsite/-/caller-callsite-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caller-callsite_3.0.0_1527270978320_0.06904103483848645"},"_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":1527270978760,"_cnpm_publish_time":1527270978760,"dist-tags":{"latest":"6.0.0"}}