https://github.com/serapath/stackframes
stackframes https://www.npmjs.com/package/stackframes
https://github.com/serapath/stackframes
callsite callsites errorstack framestack stack stackerror stackframe stackframes stacks stacksite stacksites stacktrace stacktraces trace tracert
Last synced: 10 months ago
JSON representation
stackframes https://www.npmjs.com/package/stackframes
- Host: GitHub
- URL: https://github.com/serapath/stackframes
- Owner: serapath
- License: mit
- Created: 2020-05-21T17:21:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T14:58:26.000Z (over 5 years ago)
- Last Synced: 2025-03-15T08:42:36.654Z (11 months ago)
- Topics: callsite, callsites, errorstack, framestack, stack, stackerror, stackframe, stackframes, stacks, stacksite, stacksites, stacktrace, stacktraces, trace, tracert
- Language: JavaScript
- Homepage: https://serapath.github.io/stackframes/
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stackframes
[](https://app.saucelabs.com/u/serapath)
https://www.npmjs.com/package/stackframes
https://serapath.github.io/stackframes/
---
[](https://saucelabs.com/u/serapath)
# use
`npm install stackframes`
```js
const stackframes = require('stackframes')
demo()
function demo () {
var error
try {
function foobarbaz () { throw new Error('foobar') }
function bazbarfoo () { foobarbaz() }
bazbarfoo()
} catch (e) {
error = e
}
example()
function example () { foo() }
function foo () { bar() }
function bar () { baz() }
function baz () {
const defaultFlags = stackframes.defaultFlags
console.log(defaultFlags)
const flags = defaultFlags.filter((_, i) => i%2) // take every second flag
console.log('0', stackframes(error, flags))
console.log('1', stackframes())
console.log('2', stackframes({ exclude: foo }))
console.log('3', stackframes({ exclude: example }))
console.log('4', stackframes({ depths: 2, exclude: baz }))
console.log('5', stackframes({ depths: 2 }))
console.log('6', stackframes(null, flags))
}
}
```
## supported by
