{"_id":"caller","_rev":"4086261","name":"caller","description":"@substack's caller.js as a module","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"krakenjs-user","email":""},{"name":"totherik","email":"totherik@gmail.com"}],"time":{"modified":"2025-12-02T22:11:10.000Z","created":"2013-12-22T20:28:33.058Z","1.1.0":"2022-03-10T18:08:15.357Z","1.0.1":"2015-09-27T01:21:24.985Z","1.0.0":"2014-09-12T15:16:22.247Z","0.0.1":"2013-12-22T20:28:33.058Z"},"users":{"erikvold":true,"j3kz":true,"pagoru":true},"author":{"name":"Erik Toth","email":"totherik@gmail.com"},"repository":{"type":"git","url":"git://github.com/totherik/caller.git"},"versions":{"1.1.0":{"name":"caller","version":"1.1.0","description":"@substack's caller.js as a module","main":"index.js","scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/totherik/caller.git"},"keywords":["caller","file","require"],"author":{"name":"Erik Toth","email":"totherik@gmail.com"},"license":"MIT","devDependencies":{"tape":"~2.3.2"},"gitHead":"15bef0805246629cc89fb71ded29e674009ffc45","dependencies":{},"bugs":{"url":"https://github.com/totherik/caller/issues"},"homepage":"https://github.com/totherik/caller#readme","_id":"caller@1.1.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"shasum":"46228555cfecb57d82bcd173b493f87cee9680fe","size":2057,"noattachment":false,"key":"/caller/-/caller-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/caller/download/caller-1.1.0.tgz"},"_npmUser":{"name":"krakenjs-user","email":"medelman@paypal.com"},"directories":{},"maintainers":[{"name":"krakenjs-user","email":""},{"name":"totherik","email":"totherik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caller_1.1.0_1646935695230_0.8221706663990187"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-10T18:08:19.080Z","publish_time":1646935695357,"_cnpm_publish_time":1646935695357},"1.0.1":{"name":"caller","version":"1.0.1","description":"@substack's caller.js as a module","main":"index.js","files":["index.js"],"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/totherik/caller.git"},"keywords":["caller","file","require"],"author":{"name":"Erik Toth","email":"totherik@gmail.com"},"license":"MIT","devDependencies":{"tape":"~2.3.2"},"gitHead":"15bef0805246629cc89fb71ded29e674009ffc45","dependencies":{},"bugs":{"url":"https://github.com/totherik/caller/issues"},"homepage":"https://github.com/totherik/caller","_id":"caller@1.0.1","_shasum":"b851860f70e195db3d277395aa1a7e23ea30ecf5","_from":".","_npmVersion":"2.6.1","_nodeVersion":"0.10.33","_npmUser":{"name":"totherik","email":"totherik@gmail.com"},"maintainers":[{"name":"krakenjs-user","email":""},{"name":"totherik","email":"totherik@gmail.com"}],"dist":{"shasum":"b851860f70e195db3d277395aa1a7e23ea30ecf5","size":2387,"noattachment":false,"key":"/caller/-/caller-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/caller/download/caller-1.0.1.tgz"},"directories":{},"publish_time":1443316884985,"_cnpm_publish_time":1443316884985,"_hasShrinkwrap":false},"1.0.0":{"name":"caller","version":"1.0.0","description":"@substack's caller.js as a module","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/totherik/caller.git"},"keywords":["caller","file","require"],"author":{"name":"Erik Toth","email":"totherik@gmail.com"},"license":"MIT","devDependencies":{"tape":"~2.3.2"},"gitHead":"15bef0805246629cc89fb71ded29e674009ffc45","dependencies":{"tape":"~2.3.2"},"bugs":{"url":"https://github.com/totherik/caller/issues"},"homepage":"https://github.com/totherik/caller","_id":"caller@1.0.0","_shasum":"9e454286ed5b1e680336af306f3fb92ee3b7d3d3","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"totherik","email":"totherik@gmail.com"},"maintainers":[{"name":"krakenjs-user","email":""},{"name":"totherik","email":"totherik@gmail.com"}],"dist":{"shasum":"9e454286ed5b1e680336af306f3fb92ee3b7d3d3","size":3203,"noattachment":false,"key":"/caller/-/caller-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/caller/download/caller-1.0.0.tgz"},"publish_time":1410534982247,"_cnpm_publish_time":1410534982247,"_hasShrinkwrap":false},"0.0.1":{"name":"caller","version":"0.0.1","description":"@substack's caller.js as a module","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/totherik/caller.git"},"keywords":["caller","file","require"],"author":{"name":"Erik Toth","email":"totherik@gmail.com"},"license":"MIT","devDependencies":{"tape":"~2.3.2"},"readmeFilename":"README.md","gitHead":"15bef0805246629cc89fb71ded29e674009ffc45","dependencies":{"tape":"~2.3.2"},"bugs":{"url":"https://github.com/totherik/caller/issues"},"homepage":"https://github.com/totherik/caller","_id":"caller@0.0.1","dist":{"shasum":"f37a1d6ea10e829d94721ae29a90bb4fb52ab767","size":2848,"noattachment":false,"key":"/caller/-/caller-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/caller/download/caller-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"totherik","email":"totherik@gmail.com"},"maintainers":[{"name":"krakenjs-user","email":""},{"name":"totherik","email":"totherik@gmail.com"}],"publish_time":1387744113058,"_cnpm_publish_time":1387744113058,"_hasShrinkwrap":false}},"readme":"#### caller\n\nFigure out your caller (thanks to @substack).\n\n##### Initialization Time Caller\n```javascript\n// foo.js\n\nvar bar = require('bar');\n```\n\n```javascript\n// bar.js\n\nvar caller = require('caller');\nconsole.log(caller()); // `/path/to/foo.js`\n```\n\n##### Runtime Caller\n```javascript\n// foo.js\n\nvar bar = require('bar');\nbar.doWork();\n```\n\n```javascript\n// bar.js\n\nvar caller = require('caller');\n\nexports.doWork = function () {\n    console.log(caller());  // `/path/to/foo.js`\n};\n```\n\n### Depth\n\nCaller also accepts a `depth` argument for tracing back further (defaults to `1`).\n\n```javascript\n// foo.js\n\nvar bar = require('bar');\nbar.doWork();\n```\n\n```javascript\n// bar.js\n\nvar baz = require('baz');\n\nexports.doWork = function () {\n    baz.doWork();\n};\n```\n\n```javascript\n// baz.js\n\nvar caller = require('caller');\n\nexports.doWork = function () {\n    console.log(caller(2));  // `/path/to/foo.js`\n};\n```\n","_attachments":{},"homepage":"https://github.com/totherik/caller#readme","bugs":{"url":"https://github.com/totherik/caller/issues"},"license":"MIT"}