# @distributed-systems/callsite

> get structured callsite information

Latest version **4.0.0** (published 2025-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @distributed-systems/callsite
pnpm add @distributed-systems/callsite
yarn add @distributed-systems/callsite
bun add @distributed-systems/callsite
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2025-10-28 |
| First published | 2018-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Lina van der Weg |
| Maintainers | ee |
| Keywords | callsite |

## Links

- npm: https://www.npmjs.com/package/@distributed-systems/callsite
- Repository: https://github.com/distributed-systems/callsite
- Homepage: https://github.com/distributed-systems/callsite#readme
- Issues: https://github.com/distributed-systems/callsite/issues
- npm.io page: https://npm.io/package/@distributed-systems/callsite

## Dependencies (1)

- [error-stack-parser](https://npm.io/package/error-stack-parser.md) ^2.1.4

## Recent versions

- 4.0.0 (latest) — 2025-10-28
- 3.0.1 — 2022-03-30
- 3.0.0 — 2021-08-30
- 2.0.0 — 2018-11-21
- 1.1.1 — 2018-01-04
- 1.1.0 — 2018-01-03
- 1.0.0 — 2018-01-03

## README

# Callsite

Get structured callsite information

If you just need structured stack-frames, please use the [Stack-Trace](https://github.com/distributed-systems/stack-trace) library


ESM:
```javascript
import Callsite from 'es-modules/distributed-systems/callsite/2.0.0+/index.mjs';
```


NPM:
```javascript
import Callsite from '@distributed-systems/callsite';

```


### API

**Stack Frame format returned from the library**
```javascript
[{
    name: 'new Cls',
    source: 'stack-trace/test/200.000-stack-parser.mjs',
    line: 52,
    column: 27 
}]
```

**Get Callsite Info**
```javascript
const cs = new Callsite();

// get callsite info
const callsite info = cs.getStack(); 

```


**Get Callsite Info, more frames**
```javascript
const cs = new Callsite();

// get callsite info
const callsite info = cs.getStack({
    limit: 100,
}); 

```


**Get Callsite Info, from a custom error**
```javascript
const cs = new Callsite();
const err = new Error('my custom error');

// get callsite info
const callsite info = cs.getStack({
    limit: 100,
    err,
});

```

---
_Source: https://npm.io/package/@distributed-systems/callsite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
