-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtrace.node.txt
45 lines (39 loc) · 2.75 KB
/
trace.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
┏━━━━━━━━━━━┓
┃ TRACE ┃
┗━━━━━━━━━━━┛
ALTERNATIVES ==> #All are Node.js only:
# - Node.js >=12.0.0 (prefered):
# - only for async|await and Promise.all()
# - andreasmadsen trace (prefered if needs more async operations support):
# - high-profile
# - uses ASYNC_HOOKS
# - supports stackTraceLimit
# - longjohn:
# - high-profile but not well maintained
# - monkey-patches setTimeout(), etc. to retrieve current stack before firing callback
# - source map support
# - supports stackTraceLimit
# - does not work with PROMISEs
# - long-promise:
# - not maintained
# - uses ASYNC_HOOKS
# - only for PROMISEs and require manually calling a function on each ERROR
# - node-stackup:
# - not maintained
# - uses old version of ASYNC_HOOKS
# - asynctrace:
# - not maintained
# - uses old version of ASYNC_HOOKS
# - crabdude trycatch:
# - not maintained
# - uses domain API (deprecated)
# - supports stackTraceLimit
# - beautifies error
VERSION ==> #3.1.1
PERFORMANCE ==> #It has serious impact on CPU usage and slow things down
#Also there is an important memory leak.
#I.e. it should be used in development only.
HOW ==> # - uses stack-chain (see its doc) to manipulate stack trace (using Error.prepareStackTrace())
# - create an ASYNC-HOOK (see Node core doc) that keeps track (in a global object) of current
# stack trace before starting any child microtask
require('trace') #Performs the substitution on require()