{"_id":"callsites","_rev":"3464086","name":"callsites","description":"Get callsites from the V8 stack trace API","dist-tags":{"latest":"4.2.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2024-08-27T19:36:54.000Z","created":"2014-04-19T10:11:43.316Z","4.2.0":"2024-06-29T13:46:24.572Z","4.1.0":"2023-08-12T14:28:07.954Z","4.0.0":"2021-08-08T23:17:12.301Z","3.1.0":"2019-04-06T11:57:30.657Z","3.0.0":"2018-11-19T17:36:49.033Z","2.0.0":"2016-08-28T00:30:10.498Z","1.0.1":"2016-05-11T13:34:39.471Z","1.0.0":"2014-08-17T18:47:35.372Z","0.2.0":"2014-04-19T10:12:18.747Z","0.1.0":"2014-04-19T10:11:43.316Z"},"users":{"servel333":true,"alvis":true,"wangnan0610":true,"zuojiang":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/callsites.git"},"versions":{"4.2.0":{"name":"callsites","version":"4.2.0","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/callsites.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":">=12.20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stacktrace","v8","callsite","callsites","stack","trace","function","file","line","debug"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"_id":"callsites@4.2.0","gitHead":"d782915ed4ef09a5cf44dddff7a55765cfb865c6","bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"shasum":"98761d5be3ce092e4b9c92f7fb8c8eb9b83cadc8","size":2544,"noattachment":false,"key":"/callsites/-/callsites-4.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-4.2.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callsites_4.2.0_1719668784407_0.26992061774254306"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-29T13:46:24.572Z","publish_time":1719668784572,"_source_registry_name":"default","maintainers":[{"name":"sindresorhus","email":""}],"_cnpm_publish_time":1719668784572},"4.1.0":{"name":"callsites","version":"4.1.0","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/callsites.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12.20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stacktrace","v8","callsite","callsites","stack","trace","function","file","line","debug"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"types":"./index.d.ts","gitHead":"6bd2cc07b0710d6ef9e0b09122745b1c275797f9","bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites#readme","_id":"callsites@4.1.0","_nodeVersion":"16.20.0","_npmVersion":"9.2.0","dist":{"shasum":"de72b98612eed4e1e2564c952498677faa9d86c2","size":2590,"noattachment":false,"key":"/callsites/-/callsites-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-4.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callsites_4.1.0_1691850487630_0.5614972985982614"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-12T14:28:07.954Z","publish_time":1691850487954,"_source_registry_name":"default","_cnpm_publish_time":1691850487954},"4.0.0":{"name":"callsites","version":"4.0.0","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/callsites.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12.20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stacktrace","v8","callsite","callsites","stack","trace","function","file","line","debug"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"467c1de91e4e4d6f4c540c1ab99a7d47ee565471","bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites#readme","_id":"callsites@4.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"shasum":"8014cea4fedfe681a30e2f7d2d557dd95808a92a","size":2522,"noattachment":false,"key":"/callsites/-/callsites-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callsites_4.0.0_1628464631967_0.9082832754794896"},"_hasShrinkwrap":false,"publish_time":1628464632301,"_cnpm_publish_time":1628464632301},"3.1.0":{"name":"callsites","version":"3.1.0","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/callsites.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stacktrace","v8","callsite","callsites","stack","trace","function","file","line","debug"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"f89815af2e0255094283c86977f1e679a8fb411b","bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites#readme","_id":"callsites@3.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b3630abd8943432f54b3f0519238e33cd7df2f73","size":2433,"noattachment":false,"key":"/callsites/-/callsites-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callsites_3.1.0_1554551850429_0.3545214734540718"},"_hasShrinkwrap":false,"publish_time":1554551850657,"_cnpm_publish_time":1554551850657},"3.0.0":{"name":"callsites","version":"3.0.0","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/callsites.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["stacktrace","v8","callsite","callsites","stack","trace","function","file","line","debug"],"devDependencies":{"ava":"^0.25.0","tsd-check":"^0.2.1","xo":"^0.23.0"},"gitHead":"3bc8adc7a7a9d3c4c54ec935c8890c31db165fb1","bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites#readme","_id":"callsites@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"fb7eb569b72ad7a45812f93fd9430a3e410b3dd3","size":2297,"noattachment":false,"key":"/callsites/-/callsites-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callsites_3.0.0_1542649008789_0.5312700033194684"},"_hasShrinkwrap":false,"publish_time":1542649009033,"_cnpm_publish_time":1542649009033},"2.0.0":{"name":"callsites","version":"2.0.0","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/callsites.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["stacktrace","v8","callsite","callsites","stack","trace","function","file","line","debug"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"76081d07c93d0ec3657d2be3c300bb21f45cf9db","bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites#readme","_id":"callsites@2.0.0","_shasum":"06eb84f00eea413da86affefacbffb36093b3c50","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"06eb84f00eea413da86affefacbffb36093b3c50","size":2004,"noattachment":false,"key":"/callsites/-/callsites-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/callsites-2.0.0.tgz_1472344208744_0.7568928482942283"},"directories":{},"publish_time":1472344210498,"_cnpm_publish_time":1472344210498,"_hasShrinkwrap":false},"1.0.1":{"name":"callsites","version":"1.0.1","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/callsites.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["stacktrace","v8","callsite","callsites","stack","trace","function","file","line","debug"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"c18e4ce8ce38fb0e628f9a423471c9bac991e42a","bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites#readme","_id":"callsites@1.0.1","_shasum":"c14c24188ce8e1d6a030b4c3c942e6ba895b6a1a","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c14c24188ce8e1d6a030b4c3c942e6ba895b6a1a","size":1995,"noattachment":false,"key":"/callsites/-/callsites-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/callsites-1.0.1.tgz_1462973676632_0.5280761285685003"},"directories":{},"publish_time":1462973679471,"_cnpm_publish_time":1462973679471,"_hasShrinkwrap":false},"1.0.0":{"name":"callsites","version":"1.0.0","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/callsites"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["callsites","callsite","v8","stacktrace","stack","trace","function","file","line","debug"],"devDependencies":{"mocha":"*"},"gitHead":"a5f41b0b95a6b8763cb392def8e07e7a88670b02","bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites","_id":"callsites@1.0.0","_shasum":"02563b10ed31f2ebd95893a776f0b3d95a6b15b8","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"02563b10ed31f2ebd95893a776f0b3d95a6b15b8","size":1346,"noattachment":false,"key":"/callsites/-/callsites-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-1.0.0.tgz"},"directories":{},"publish_time":1408301255372,"_cnpm_publish_time":1408301255372,"_hasShrinkwrap":false},"0.2.0":{"name":"callsites","version":"0.2.0","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/callsites"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["callsites","callsite","v8","stacktrace","stack","trace","function","file","line","debug"],"devDependencies":{"mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites","_id":"callsites@0.2.0","dist":{"shasum":"afab96262910a7f33c19a5775825c69f34e350ca","size":1343,"noattachment":false,"key":"/callsites/-/callsites-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-0.2.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1397902338747,"_cnpm_publish_time":1397902338747,"_hasShrinkwrap":false},"0.1.0":{"name":"callsites","version":"0.1.0","description":"Get callsites from the V8 stack trace API","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/callsites"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["callsites","callsite","v8","stacktrace","stack","trace","function","file","line","debug"],"devDependencies":{"mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"homepage":"https://github.com/sindresorhus/callsites","_id":"callsites@0.1.0","dist":{"shasum":"2b856278a6948e4afe55f2600d05f89bd88b492a","size":1342,"noattachment":false,"key":"/callsites/-/callsites-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/callsites/download/callsites-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1397902303316,"_cnpm_publish_time":1397902303316,"_hasShrinkwrap":false}},"readme":"# callsites\n\n> Get callsites from the [V8 stack trace API](https://v8.dev/docs/stack-trace-api)\n\n## Install\n\n```sh\nnpm install callsites\n```\n\n## Usage\n\n```js\nimport callsites from 'callsites';\n\nfunction unicorn() {\n\tconsole.log(callsites()[0].getFileName());\n\t//=> '/Users/sindresorhus/dev/callsites/test.js'\n}\n\nunicorn();\n```\n\n## API\n\nReturns an array of callsite objects with the following methods:\n\n- `getThis`: Returns the value of `this`.\n- `getTypeName`: Returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property.\n- `getFunction`: Returns the current function.\n- `getFunctionName`: Returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context.\n- `getMethodName`: Returns the name of the property of `this` or one of its prototypes that holds the current function.\n- `getFileName`: If this function was defined in a script returns the name of the script.\n- `getLineNumber`: If this function was defined in a script returns the current line number.\n- `getColumnNumber`: If this function was defined in a script returns the current column number\n- `getEvalOrigin`: If this function was created using a call to `eval` returns a string representing the location where `eval` was called.\n- `isToplevel`: Returns `true` if this is a top-level invocation, that is, if it's a global object.\n- `isEval`: Returns `true` if this call takes place in code defined by a call to `eval`.\n- `isNative`: Returns `true` if this call is in native V8 code.\n- `isConstructor`: Returns `true` if this is a constructor call.\n- `isAsync()`: \tReturns `true` if this call is asynchronous (i.e. `await`, `Promise.all()`, or `Promise.any()`).\n- `isPromiseAll()`: Returns `true` if this is an asynchronous call to `Promise.all()`.\n- `getPromiseIndex()`: Returns the index of the promise element that was followed in `Promise.all()` or `Promise.any()` for async stack traces, or `null` if the `CallSite` is not an asynchronous `Promise.all()` or `Promise.any()` call.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/callsites#readme","bugs":{"url":"https://github.com/sindresorhus/callsites/issues"},"license":"MIT"}