3.0.1 • Published 2 years ago

@distributed-systems/callsite v3.0.1

Weekly downloads
9,641
License
MIT
Repository
github
Last release
2 years ago

Callsite

Get structured callsite information

If you just need structured stack-frames, please use the Stack-Trace library

ESM:

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

NPM:

import Callsite from '@distributed-systems/callsite';

API

Stack Frame format returned from the library

[{
    name: 'new Cls',
    source: 'stack-trace/test/200.000-stack-parser.mjs',
    line: 52,
    column: 27 
}]

Get Callsite Info

const cs = new Callsite();

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

Get Callsite Info, more frames

const cs = new Callsite();

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

Get Callsite Info, from a custom error

const cs = new Callsite();
const err = new Error('my custom error');

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

2 years ago

3.0.0

3 years ago

2.0.0

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago