New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

longjohn

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

longjohn

Long stack traces for node.js inspired by https://github.com/tlrobinson/long-stack-traces

  • 0.2.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

longjohn

Long stack traces for node.js with configurable call trace length

Inspiration

I wrote this while trying to add long-stack-traces to my server and realizing that there were issues with support of EventEmitter::removeListener. The node HTTP Server will begin to leak callbacks and any of your own code that relies on removing listeners would not work as anticipated.

So what to do... I stole the code and rewrote it. I've added support for removeListener along with the ability to cut off the number of async calls the library will trace. I hope you like it!

Please thank tlrobinson for the initial implementation!

Production Use

Longjohn collects a large amount of data in order to provide useful stack traces. While it is very helpful in development and testing environments, it is not recommended to use longjohn in production. The data collection puts a lot of strain on V8's garbage collector and can greatly slow down heavily-loaded applications.

Installation

Just npm install it!

$ npm install longjohn

Usage

To use longjohn, require it in your code (probably in some initialization code). That's all!

if (process.env.NODE_ENV !== 'production'){
  require('longjohn');
}

// ... your code

Options

Limit traced async calls
longjohn.async_trace_limit = 5;   // defaults to 10
longjohn.async_trace_limit = -1;  // unlimited
Change callback frame text
longjohn.empty_frame = 'ASYNC CALLBACK';  // defaults to '---------------------------------------------'

FAQs

Package last updated on 28 Mar 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