Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
stack-generator
Advanced tools
Generate artificial backtrace by walking arguments.callee.caller chain
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.
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);
This package also parses JavaScript stack traces. It extracts structured information from stack traces generated by different browsers, providing a more cross-browser compatible solution compared to stack-generator.
Stacktrace-js offers similar functionalities by providing stack traces but goes further by allowing better cross-browser stack trace collection and source mapping, which can be more useful for debugging applications that need to support multiple browsers.
Generate artificial stacktrace by walking arguments.callee.caller
chain. Works everywhere except strict-mode.
StackGenerator.backtrace()
=> [StackFrame({functionName: 'foo', args: []}), StackFrame(..), StackFrame(..)]
npm install stack-generator
bower install stack-generator
https://raw.githubusercontent.com/stacktracejs/stack-generator/master/dist/stack-generator.min.js
Want to be listed as a Contributor? Start with the Contributing Guide!
FAQs
Generate artificial backtrace by walking arguments.callee.caller chain
The npm package stack-generator receives a total of 2,092,727 weekly downloads. As such, stack-generator popularity was classified as popular.
We found that stack-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.