# stackback

> return list of CallSite objects from a captured stacktrace

Latest version **0.0.2** (published 2012-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install stackback
pnpm add stackback
yarn add stackback
bun add stackback
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2012-10-20 |
| First published | 2012-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Roman Shtylman |
| Maintainers | shtylman |
| Keywords | stacktrace, trace, stack |

## Links

- npm: https://www.npmjs.com/package/stackback
- Repository: https://github.com/shtylman/node-stackback
- npm.io page: https://npm.io/package/stackback

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2012-10-20
- 0.0.1 — 2012-10-08

## README

# stackback

Returns an array of CallSite objects for a captured stacktrace. Useful if you want to access the frame for an error object.

## use

```javascript
var stackback = require('stackback');

// error generated from somewhere
var err = new Error('some sample error');

// stack is an array of CallSite objects
var stack = stackback(err);
```

## CallSite object

From the [V8 StackTrace API](https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi)

The structured stack trace is an Array of CallSite objects, each of which represents a stack frame. A CallSite object defines the following methods

getThis: returns the value of this  
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.  
getFunction: returns the current function  
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.  
getMethodName: returns the name of the property of this or one of its prototypes that holds the current function  
getFileName: if this function was defined in a script returns the name of the script  
getLineNumber: if this function was defined in a script returns the current line number  
getColumnNumber: if this function was defined in a script returns the current column number  
getEvalOrigin: if this function was created using a call to eval returns a CallSite object representing the location where eval was called  
isToplevel: is this a toplevel invocation, that is, is this the global object?  
isEval: does this call take place in code defined by a call to eval?  
isNative: is this call in native V8 code?  
isConstructor: is this a constructor call?  

## install

```shell
npm install stackback
```

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