{"name":"caller-callsite","version":"1.0.0","description":"Get the callsite of the caller function","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/caller-callsite"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["caller","calling","module","parent","callsites","callsite","stacktrace","stack","trace","function","file"],"dependencies":{"callsites":"^1.0.0"},"devDependencies":{"ava":"0.0.4"},"gitHead":"365b9d2cd05c2481956dc95f2921a6adc35af6e3","bugs":{"url":"https://github.com/sindresorhus/caller-callsite/issues"},"homepage":"https://github.com/sindresorhus/caller-callsite","_id":"caller-callsite@1.0.0","_shasum":"188f9228bf0bdf5cf36d67a89b5cf6dff00173e9","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"dist":{"shasum":"188f9228bf0bdf5cf36d67a89b5cf6dff00173e9","tarball":"http://registry-npm.ywwl.com/caller-callsite/download/caller-callsite-1.0.0.tgz","integrity":"sha512-5aKhEaoWYi9PepgHiqkUIYtPk0NqunsJI+rJ+rbalf/AMvBxR1RLglthrtZAnWu6RbKghhwSCpDSeBLGsaT/kQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5FdsbZTeEuQr1lW4hp/13N5yiYcEEZdN6O6mvGg4KMAiEAw6fvIYVUY3dO80q3rJ4PSavf2MIDIP3PNgDk4E5LDoI="}],"size":910,"noattachment":false,"key":"/caller-callsite/-/caller-callsite-1.0.0.tgz"},"directories":{},"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":1422116356821,"_cnpm_publish_time":1422116356821,"dist-tags":{"latest":"6.0.0"}}