# callers-path

> caller's path with knobs

Latest version **1.0.5** (published 2015-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install callers-path
pnpm add callers-path
yarn add callers-path
bun add callers-path
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2015-06-23 |
| First published | 2014-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.9.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Javier Carrillo |
| Maintainers | stringparser |
| Keywords | v8, callsite, callsites, path, caller |

## Links

- npm: https://www.npmjs.com/package/callers-path
- Repository: https://github.com/stringparser/callers-path
- Issues: https://github.com/stringparser/callers-path/issues
- npm.io page: https://npm.io/package/callers-path

## Dependencies (1)

- [v8-callsites](https://npm.io/package/v8-callsites.md) ^1.0.34

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2015-06-23
- 1.0.4 — 2015-06-23
- 1.0.3 — 2014-10-15
- 1.0.2 — 2014-10-15
- 1.0.1 — 2014-10-15
- 1.0.0 — 2014-10-15
- 0.9.11 — 2014-10-15
- 0.9.10 — 2014-10-15
- 0.9.9 — 2014-10-09
- 0.9.8 — 2014-10-09
- 0.9.7 — 2014-10-08
- 0.9.6 — 2014-10-05
- 0.9.5 — 2014-10-05
- 0.9.4 — 2014-10-05
- 0.9.3 — 2014-10-05
- … 3 more at https://npm.io/package/callers-path/versions

## README

# callers-path 

[<img alt="build" src="http://img.shields.io/travis/stringparser/callers-path/master.svg?style=flat-square" align="left"/>](https://travis-ci.org/stringparser/callers-path/builds)
[<img alt="NPM version" src="http://img.shields.io/npm/v/callers-path.svg?style=flat-square" align="right"/>](http://www.npmjs.org/package/callers-path)
<br>

[V8 stacktrace API](https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi) based caller's path

## install

    npm install --save callers-path

## usage

example/moduleB.js
```js
var callersPath = require('callers-path');
module.exports = function(){
  console.log(callersPath());
};
```

example/moduleA.js

```js
var moduleB = require('./moduleB');
    moduleB();
// => example/moduleA.js
```

### documentation

`require('callers-path')([frames, origin])`

 - `frames` if specified should be an `integer` bigger than `0` or `Infinity`.
 - `origin` if specified should be a function.
 - if no arguments, the default number of `frames` is `2` so the `origin` is the module itself. The stack is sliced by one.

## why

You would like to set how many frames are recorded (`Error.stackTraceLimit`) and from which function the stack should be traced back (`Error.captureStackTrace`).

By default two frames are recorded, though you can even lower it to one providing a function from which start.

### inspirated by

It serves for the same use cases implemented on this cool modules

 - [visionmedia `callsite`](https://github.com/visionmedia/callsite)
 - [sindresorhus `callsites`](https://github.com/sindresorhus/callsites)
 - [sindresorhus `caller-path`](https://github.com/sindresorhus/caller-path)

## test

    npm test

### license

[<img alt="LICENSE" src="http://img.shields.io/npm/l/callers-path.svg?style=flat-square"/>](http://opensource.org/licenses/MIT)

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