Socket
Socket
Sign inDemoInstall

stack-generator

Package Overview
Dependencies
1
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stack-generator

Generate artificial backtrace by walking arguments.callee.caller chain


Version published
Maintainers
2
Install size
63.0 kB
Created

Package description

What is stack-generator?

The stack-generator npm package is a utility for generating stack traces for JavaScript errors. It provides a way to capture, manipulate, and analyze stack traces, which can be useful for debugging and error handling in JavaScript applications.

What are stack-generator's main functionalities?

Generating stack traces

This feature allows developers to generate a stack trace at any point in their code. The `backtrace` method captures the current call stack and returns it as an array of stack frames.

const StackGenerator = require('stack-generator');
const stack = StackGenerator.backtrace();
console.log(stack);

Filtering stack traces

This feature enables developers to filter out specific stack frames from the stack trace based on certain conditions, such as excluding frames from specific functions.

const StackGenerator = require('stack-generator');
const stack = StackGenerator.backtrace();
const filteredStack = stack.filter(frame => frame.functionName !== 'FunctionToIgnore');
console.log(filteredStack);

Other packages similar to stack-generator

Readme

Source

stack-generator

Build Status Coverage Status GitHub license

Generate artificial backtrace by walking arguments.callee.caller chain. Works everywhere except strict-mode.

Usage

StackGenerator.backtrace()

=> [StackFrame({functionName: 'foo', args: []}), StackFrame(..), StackFrame(..)]

Installation

npm install stack-generator
bower install stack-generator
https://raw.githubusercontent.com/stacktracejs/stack-generator/master/dist/stack-generator.min.js

Browser Support

Sauce Test Status

Contributing

Want to be listed as a Contributor? Start with the Contributing Guide!

License

This project is licensed to the Public Domain

Keywords

FAQs

Last updated on 13 Aug 2017

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