• Stars
    star
    824
  • Rank 55,348 (Top 2 %)
  • Language
    CoffeeScript
  • License
    MIT License
  • Created over 12 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 '---------------------------------------------'

Use with Source Maps

As of version 0.2.9 longjonn supports source maps. Just compile your code down to javascript with source map support and run like normal.

For coffee-script, this would look like:

$ coffee --map --compile script.coffee

More Repositories

1

spellbinder

Real-time view/model binding for backbone.js
CoffeeScript
44
star
2

trojan

Package your source and dependencies in 1 file for easy distribution
JavaScript
17
star
3

facebook.node

Facebook API Client for Node.js
JavaScript
17
star
4

caboose

Coffeescript-happy express-based server-side MVC framework loosely based on rails
CoffeeScript
16
star
5

guiceymongo

Guice integration for MongoDB. Related Projects: guiceytools, guiceymongo-generator
Java
15
star
6

com.lowereast.guiceymongo

Guice integration for MongoDB - This is being moved to guiceytools, guiceymongo, and guiceymongo-generator. Check out my other projects to find them.
Java
14
star
7

guiceymongo-generator

Related Projects: guiceytools, guiceymongo
Java
10
star
8

todo-backend-modern-js

An implementation of Todo-Backend using modern Javascript features
JavaScript
8
star
9

firebase-work

Firebase work-queue system
CoffeeScript
7
star
10

guiceytools

Related Projects: guiceymongo, guiceymongo-generator
Java
6
star
11

heroku.node

Heroku API client for node.js
CoffeeScript
6
star
12

packed

Pack and unpack structures to/from Buffers
CoffeeScript
5
star
13

bittrex-client

TypeScript
5
star
14

marathon.node

Marathon v2 API client for Node.js
CoffeeScript
5
star
15

getglue-client

GetGlue Java Client
Java
5
star
16

resig-class

http://ejohn.org/blog/simple-javascript-inheritance/
JavaScript
5
star
17

syncr

syncr helps you deal with the details of remote file synchronization
CoffeeScript
4
star
18

access-mongo

Simple MongoDB wrapper
JavaScript
3
star
19

porter

Porter is a job queue/worker system built on redis for use at PageLever.
CoffeeScript
3
star
20

bitly.node

JavaScript
3
star
21

lucy

TypeScript
2
star
22

bitbucket.node

Bitbucket 2.0 API client for node.js
CoffeeScript
2
star
23

caboose-bootstrap

JavaScript
2
star
24

rest.node

CoffeeScript
2
star
25

strappy

bootstrapper for node
JavaScript
2
star
26

webpack-dev-container

Webpack inside of a docker container, with a local flie-watcher client
TypeScript
2
star
27

clowdy

TypeScript
2
star
28

redis-builder

Easily create/configure a redis client
JavaScript
2
star
29

pagelever-shots

JavaScript
1
star
30

awesomebox-client

JavaScript
1
star
31

com.lowereast.jmx

JMX configuration for Guice
Java
1
star
32

tubing

JavaScript
1
star
33

caboose-authentication

Caboose plugin to add authentication methods to caboose controllers
CoffeeScript
1
star
34

garnish

A useful group of decorators
JavaScript
1
star
35

protos

TypeScript
1
star
36

mailgun.node

node.js helper library for mailgun.net
1
star
37

awesomebox-cli

CoffeeScript
1
star
38

mongodb-tools

CoffeeScript
1
star
39

switchback

JavaScript
1
star
40

firebase-builder

Easily create/configure a Firebase client
JavaScript
1
star
41

cement-example

Java
1
star
42

caboosejs.com

Documentation website for Caboose
CoffeeScript
1
star
43

postmark.node

Postmark Client for Node.js
CoffeeScript
1
star
44

cement-mongo

Java
1
star
45

cement

Web services framework which aims to allow developers to concentrate on business logic and create better tests.
Java
1
star
46

caboose-model

CoffeeScript
1
star
47

crypto-unit

TypeScript
1
star
48

check-urls

Check the response code of a list of URLs with electron
JavaScript
1
star
49

procinfo

CoffeeScript
1
star
50

walkabout

Path Utility for node.js
JavaScript
1
star
51

react-formish

React forms library
TypeScript
1
star
52

work-it

Worker system with pluggable components
JavaScript
1
star
53

caboose-model-delayed-render

Delayed rendering for caboose-model
CoffeeScript
1
star
54

keyless

CoffeeScript
1
star
55

model-lang

JavaScript
1
star
56

tubing-view

CoffeeScript
1
star
57

readability.node

JavaScript
1
star
58

mattinsler.github.com

Shell
1
star
59

sendwithus.node

Sendwithus API client for node.js
CoffeeScript
1
star
60

caboose-model-before-action

CoffeeScript
1
star