Socket
Socket
Sign inDemoInstall

stacktrace-js

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stacktrace-js

Framework-agnostic, micro-library for getting stack traces in all environments


Version published
Weekly downloads
2.6M
decreased by-1.71%
Maintainers
2
Weekly downloads
 
Created

What is stacktrace-js?

The stacktrace-js package is a JavaScript library that provides stack traces for debugging JavaScript applications. It helps developers to better understand and debug their code by providing detailed information about the call stack when an error occurs.

What are stacktrace-js's main functionalities?

Generating stack traces

This feature allows developers to generate and capture stack traces within their applications. The code sample demonstrates how to obtain a stack trace and convert it into a readable string format.

StackTrace.get().then(function(stackframes) { var stringifiedStack = stackframes.map(function(sf) { return sf.toString(); }).join('\n'); console.log(stringifiedStack); });

Instrumenting functions to automatically attach stack traces

This feature automatically attaches stack traces to errors thrown in instrumented functions. The code sample shows how to instrument a function and handle errors with attached stack traces.

function foo() { throw new Error('Bazinga!'); } foo = StackTrace.instrument(foo, function(stackframes) { var stringifiedStack = stackframes.map(function(sf) { return sf.toString(); }).join('\n'); console.log(stringifiedStack); }, function(err) { console.log(err.message); }); foo();

Other packages similar to stacktrace-js

Keywords

FAQs

Package last updated on 01 Apr 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc