A Node.js tracing and instrumentation utility that logs function calls, arguments, return values, and execution times.
njsTrace is a Node.js tracing and instrumentation utility that automatically injects tracing code into modules to log function calls, arguments, return values, and execution times. It helps developers understand code flow, debug complex issues, and identify performance bottlenecks by providing a detailed trace of runtime behavior.
Node.js developers and engineers who need to debug, profile, or analyze the execution flow of their applications, especially in complex or asynchronous codebases.
Developers choose njsTrace for its automatic, non-invasive instrumentation that requires minimal code changes, flexible output formatting, and the ability to enable/disable tracing at runtime, making it a lightweight yet powerful addition to the debugging toolkit.
A Node.js tracing and instrumentation utility
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Hijacks Node.js Module._compile() to inject tracing without source code changes, enabling easy setup with a single inject() call.
Logs function calls, arguments, return values, line numbers, and execution times, providing comprehensive insights for debugging and profiling.
Tracing can be enabled or disabled dynamically via njstrace.enabled, allowing instrumentation to be toggled without restarting the application.
Supports custom formatters and multiple output destinations, enabling tailored logging to console, files, or custom functions.
Options like wrapFunctions and inspectArgs disable V8 optimizations, introducing significant overhead that can skew performance measurements.
Glob patterns are relative to the working directory, requiring manual adjustment for apps run from subdirectories, as documented in the README.
Only modules required after inject() are instrumented, meaning the module that initializes tracing is not traced, potentially missing key code paths.