Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stacktrace-js

Package Overview
Dependencies
Maintainers
1
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

  • 0.6.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
decreased by-54.28%
Maintainers
1
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 17 Nov 2014

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