Socket
Socket
Sign inDemoInstall

@distributed-systems/callsite

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @distributed-systems/callsite

get structured callsite information


Version published
Weekly downloads
2.9K
decreased by-15.42%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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,
});

Keywords

FAQs

Last updated on 30 Mar 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc