A Node.js tracing and instrumentation utility

Overview

njsTrace - Instrumentation and Tracing

njstrace lets you easily instrument and trace you code, see all function calls, arguments, return values, as well as the time spent in each function.

Installation

npm install njstrace

Example

To start tracing with the default settings just require njstrace and call its inject method.

var njstrace = require('njstrace').inject();

Lets take a look at the following 2 files dummy "app":

main.js

// *** main.js ***
var njstrace = require('njstrace').inject(),
    mymod = require('./mymod.js');

// Use only 4 digits so the output would be easier to read
mymod.run(parseFloat(Math.random().toFixed(4)));

mymod.js

// *** mymod.js ***
exports.run = function(number) {
    number = first(number);
    printResult(number);
}

function first(i) {
    i *= 100;
    return second(i, 'sqrt');
}

function second(k, method) {
    return {input: k, output: parseFloat(Math.sqrt(k).toFixed(4)), method: method};
}

function printResult(res) {
    require('fs').writeFileSync('output.txt', JSON.stringify(res));
}

The njstrace output of this silly app would be like that

--> MyMod.run@c:\temp\tracedemo\mymod.js::17, args: {0}: 0.9967
  --> first@c:\temp\tracedemo\mymod.js::4, args: {0}: 0.9967
    --> second@c:\temp\tracedemo\mymod.js::9, args: {0}: 99.67 {1}: 'sqrt'
    <-- second@c:\temp\tracedemo\mymod.js::9, ts: 0, retLine: 10, retVal: { input: 99.67, output: 9.9835, method: 'sqrt' }
  <-- first@c:\temp\tracedemo\mymod.js::4, ts: 1, retLine: 6, retVal: { input: 99.67, output: 9.9835, method: 'sqrt' }
  --> printResult@c:\temp\tracedemo\mymod.js::13, args: {0}: { input: 99.67, output: 9.9835, method: 'sqrt' }
  <-- printResult@c:\temp\tracedemo\mymod.js::13, ts: 2, retLine: 15, retVal:
<-- MyMod.run@c:\temp\tracedemo\mymod.js::17, ts: 4, retLine: 20, retVal:

How it works?

Once njstrace.inject() is called njstrace "hijacks" node.js Module._compile() method, this method is called whenever a module is being "required", njstrace instrument the required module code, and then calls to the original Module._compile() with the instrumented code. The instrumentation just adds calls to njstrace tracing methods at the beginning of each function, at the end of each function, and before any return statement.

All these calls to njstrace tracing methods should be totally neutral and should not affect your code logic, it will however (obviously), affect the runtime performance of your code, hence it is recommended to run with tracing ONLY when debugging (there is a possibility to run with njstrace disabled and enable it when necessary, see configuration explanation below).

NOTE: Since the instrumentation happens when the Module._compile() is called, only modules that are "required" after the call to njstrace.inject() would get instrumented. Practically it means that the actual module that calls to njstrace.inject() will not be instrumented, so in the example above, there is no instrumentation on main.js

NJSTrace object

The NJSTrace object is the result of require('njstrace') it exposes the following:

inject(config)

The inject method can get a configuration object with the following:

  • enabled {boolean} - Whether tracing is active, default: true Note: njstrace will instrument the code regardless of this setting, and njstrace tracing methods would be called, they will just do nothing, so the affect on runtime peeformace should be minimal. You can enable njstrace during runtime by setting njstrace.enabled = true

  • files {string|string[]} - A glob file pattern(s) that matches the files to instrument, this can be any pattern that is supported by minimatch npm module. The matching is case-insensitive. Patterns are processed in-order with an 'or' operator, unless it's a negative pattern (i.e starts with "!") which negates (if matches) all matches up to it. default: All .js files EXCLUDING node_modules ['**/*.js', '!**/node_modules/**'] NOTE: All file paths are processed relative to the process working directory, which means that the glob patterns also have to be relative to the working directory. If you are not running your app from the "root" of your app (i.e running from a sub-direcotry "node ../server.js"), you will not be able to use the default glob patterns, a solution could be to use something like that:

var path = require('path');

// Get the relative path from the working directory to the directory of the main app file
var rel = path.relative(process.cwd(), __dirname);

// Build the glob pattern for all JS files one that excludes node_modules, and use those
var alljs = path.join(rel, '**', '*.js');
var noNodeMods = '!' + path.join(rel, '**', 'node_modules', '**');
var njstrace = require('njstrace').inject({files: [alljs, noNodeMods]}),
  • wrapFunctions {boolean} - Whether njstrace should wrap the instrumented functions in a try/catch block. Wrapping the functions in try/catch can give better tracing in case of uncaought exceptions. default: true NOTE: wrapping functions in try/catch prevent v8 optimizations on the function, don't use it when profiling.

  • logger {boolean|string|function} - Controls where the logger output should go. default: false njstrace uses the logger to log about the instrumentation process and other information messages, the logger is NOT used for writing the tracing info (for this see formatter below).

    • If Boolean, indicates whether NJSTrace will log (to the console) its progress.
    • If string, a path to an output file (absolute or relative to current working directory).
    • If function, a custom log function, gets a single {string} argument.
  • inspectArgs {boolean} - Whether njstrace should inspect the traced functions arguments and return values. default: true NOTE: Inspecting the arguments is done by passing the function's arguments object to a tracer method, passing the arguments object to another method prevent v8 optimizations on the function, don't use it when profiling.

  • formatter {Formatter|object | (Formatter|object)[]} - An instance of Formatter(s) to use for output or a config object(s) for the default formatter (read more on Formatters below)

    • if Formatter object, it will be added to the list of formatters to use
    • if object, a configuration to the default Formatter (see its options in the Formatters section below).
    • if Array, a list of formatters to use, or a list of configurations for the default formatter (can be mixed, so if two configuration objects are provided, two default formatters would be created with the given config).

enabled {boolean}

Gets or sets whether njstrace is enabled or not. This let you start your application with instrumented code, but delay start the actual tracing (say start the tracing only after a specific event etc).

// Start njstrace disabled (instrument the code but tracing is not active)
var njstrace = require('njstrace').inject({enabled: false});
// And somewhere later in the code activate the tracing
njstrace.enabled = true;

Formatters

njstrace uses formatters to write the tracing output, it can use multiple formatters so in a single run several files in different formats would be written. The formatters that njstrace will use are configured using the formatter property on the configuration object passed to the inject() method.

Default Formatter

While you can write your own Formatter object, njstrace comes with a default formatter which can be configured using an object with the following properties:

  • stdout {boolean|string|function} - Controls where the output should go. default: true

    • If Boolean, indicates whether the formatter will write output (to the console) or not.
    • If String, a path to an output file (absolute or relative to current working dir).
    • If function, this function will be used for output (gets a single string arg).
  • indentationChar {string} - The character used for output indentation of the call stack (e.g '\t', ' ', etc). default: 2 space chars

  • inspectArgsCount {number} - The number of arguments to inspect on functions entry. default: 5

  • inspectArgsMaxLen {number} - The maximum number of characters to print for each argument and return value (prevent endless prints on very long arguments). If 0 then unlimited. default: 500

  • inspectOptions {object} - The inspection is done using Node.js util.inspect method, this is an options object for that function. default: null

Example

// Create formatter options that will write to the console, limit each argument inspect output to 100 chars,
// color the arguments and use 4 spaces indentation
var consoleFormatter = {
    stdout: true, // this is actually the default and can be removed
    inspectArgsMaxLen: 100,
    indentationChar: '    ',
    inspectOptions: {colors: true}
};

// Create another formatter options that will write to a file, no limit on arguments length, and use "\t" as indentation
var fileFormatter = {
    stdout: 'trace.out',
    inspectArgsMaxLen: 0,
    indentationChar: '\t'
};

// Call inject and pass the 2 formatters config objects
var njstrace = require('njstrace').inject({
    formatter: [consoleFormatter, fileFormatter]
});

The result of the above run would be both an output to the console and output to a "trace.out" file.

Custom Formatter

Writing a custom formatter is easy, all you have to do is write a "class" that inherits from njstrace Formatter, and implement the onEntry and onExit methods.

onEntry - This method is called whenever a traced function is being called, the method gets a single args object with the following:

  • name {string} - The traced function name

  • file {string} - The traced file

  • line {number} - The traced function line number

  • args {object} - The function arguments object

  • stack {Tracer.CallStack} - The current call stack including the current traced function (see Tracer.CallStack below)

onExit - This method is called whenever a traced function returns, the method gets a single args object with the following:

  • name {string} - The traced function name

  • file {string} - The traced file

  • line {number} - The traced function line number

  • retLine {number} - The line number where the exit is (can be either a return statement of function end)

  • stack {Tracer.CallStack} - The current call stack AFTER popping the current traced function (see Tracer.CallStack below)

  • span {number} - The execution time span (milliseconds) of the traced function

  • exception {boolean} - Whether this exit is due to exception

  • returnValue {*|null} - The function return value

Tracer.CallStack - A call stack object. This is an Array object where each element is a function stack id. In order to get the function name/file/line the CallStack object has a stackMap property which is a dictionary where the key is the stack id and the value is a string in the following format fnName@fnFile:line

Example

Creating a simple formatter that writes to the console.

main.js

// Get a reference to njstrace default Formatter class
var Formatter = require('njstrace/lib/formatter.js');

// Create my custom Formatter class
function MyFormatter() {
    // No need to call Formatter ctor here
}
// But must "inherit" from Formatter
require('util').inherits(MyFormatter, Formatter);

// Implement the onEntry method
MyFormatter.prototype.onEntry = function(args) {
    console.log('Got call to %s@%s::%s, num of args: %s, stack location: %s',
                args.name, args.file, args.line, args.args.length, args.stack.length);
};

// Implement the onExit method
MyFormatter.prototype.onExit = function(args) {
    console.log('Exit from %s@%s::%s, had exception: %s, exit line: %s, execution time: %s, has return value: %s',
                args.name, args.file, args.line, args.exception, args.retLine, args.span, args.returnValue !== null);
};

// Call inject and use MyFormatter as the formatter
var njstrace = require('njstrace').inject({ formatter: new MyFormatter() }),
    b = require('./b.js');

// Do some stuff on "b"
setTimeout(function(){
    b.foo();
}, 1000);

b.js

function doFoo() {
    console.log('fooing');
    return 3;
}

exports.foo = function() {
    doFoo();
}

And the console output would be:

Got call to exports.foo@C:\MyProjects\njsTrace\test\b.js::6, num of args: 0, stack location: 1
Got call to doFoo@C:\MyProjects\njsTrace\test\b.js::1, num of args: 0, stack location: 2
fooing
Exit from doFoo@C:\MyProjects\njsTrace\test\b.js::1, had exception: false, exit line: 3, execution time: 0, has return value: true
Exit from exports.foo@C:\MyProjects\njsTrace\test\b.js::6, had exception: false, exit line: 8, execution time: 1, has return value: false

What's next?

I started this project as an experiment, next I would want to see if I can create some GUI that will parse the tracing output and display it nicely (forks are welcomed as I don't see myself getting to this :)).

Enjoy !

Comments
  • Error instrumenting OWASP's juice-shop

    Error instrumenting OWASP's juice-shop

    Hey, thank you for offering such a nice project! I appreciate the work you do with this module.

    Currently, I'm trying to integrate njstrace in OWASP's juice-shop for a student project (Novice here – sorry ;)). I wrote a custom logger which works fine when I don't trace the node_modules. But when I do, it get following error:

    (node:65302) UnhandledPromiseRejectionWarning: /Users/de1630871/Spielwiese/juice-shop/node_modules/graceful-fs/graceful-fs.js:595

    var njsTmp9244 = fs$ReadStream.apply(this, arguments), this; ^^^^

    SyntaxError: Unexpected token this at new Script (vm.js:80:7) at createScript (vm.js:274:10) at Object.runInThisContext (vm.js:326:10) at Module._compile (internal/modules/cjs/loader.js:664:28) at Module._compile (/Users/de1630871/Spielwiese/juice-shop/node_modules/njstrace/njsTrace.js:158:15) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Module.require (internal/modules/cjs/loader.js:637:17) (node:65302) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:65302) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

    I forked the juice-shop-repo and made a minimal working version of the project: https://github.com/christophschw/juice-shop

    The formatter / chainloader: https://github.com/christophschw/juice-shop/blob/master/njstrace.js Comment out line 50 and it works ...

    And the npm script is npm run start:njstrace

    Thank you for your help!

    opened by christophschw 7
  • Not working with generators

    Not working with generators

    Hello. I've fell into troubles using njsTrace with generators. If I remove the asterisk symbol from mymod.js or launch it with node directly, everything compiles fine.

    main.js:

    var njstrace = require('njstrace').inject(),
        mymod = require('./mymod.js');
    
    // Use only 4 digits so the output would be easier to read
    mymod.run();
    

    mymod.js

    exports.run = function() {
        var test = function*(){}
        console.log(123)
    }
    

    Output:

    $ node main.js 
    /home/me/tst/insp/main.js:5
    mymod.run();
          ^
    
    TypeError: mymod.run is not a function
        at Object.<anonymous> (/home/me/tst/insp/main.js:5:7)
        at Module._compile (module.js:541:32)
        at Object.Module._extensions..js (module.js:550:10)
        at Module.load (module.js:456:32)
        at tryModuleLoad (module.js:415:12)
        at Function.Module._load (module.js:407:3)
        at Function.Module.runMain (module.js:575:10)
        at startup (node.js:160:18)
        at node.js:445:3
    
    opened by aa6 6
  • Error instrumenting bluebird

    Error instrumenting bluebird

    I just got an error trying to use njstrace with bluebird. I set up a small project to reproduce the error in https://github.com/sanji-programmer/njstrace-bluebird-issue

    The error is:

    ReferenceError: njsEntryData is not defined at Object. (/home/sanji/git/njstrace-bluebird-issue/node_modules/bluebird/js/release/util.js:999:34) at Module._compile (internal/modules/cjs/loader.js:776:30) at Module._compile (/home/sanji/git/njstrace-bluebird-issue/node_modules/njstrace/njsTrace.js:158:15) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:690:17) at require (internal/modules/cjs/helpers.js:25:18) at module.exports (/home/sanji/git/njstrace-bluebird-issue/node_modules/bluebird/js/release/promise.js:66:12) npm ERR! Test failed. See above for more details.

    opened by sanji-programmer 5
  • Tracing Node's core modules?

    Tracing Node's core modules?

    Hey, me again ;)

    I wonder if it would be possible to trace Node's core modules like fs or util. I know that this is a very unusual demand but it would me help to detect anomalies during malicious behavior in Node apps. Since the source modules are implemented in Javascript, I thought it should be possible to extend the code with njsTrace, no? https://github.com/nodejs/node/tree/master/lib But I suppose that this not that trivial since core modules won't processed by Module._compiled, right? Maybe, we could use the (deprecated) natives module in order to fetch and manipulate the source code of the core modules. What do you think?

    Do you have any hints in order to meet this requirement? Have a nice weekend & thanks again!

    opened by christophschw 4
  • babel-node: this.log is not a function

    babel-node: this.log is not a function

    I'm trying to add njsTrace to Renovate. It works fine when running with nodejs, but when using babel-node, which we use for debugging, I get the following stacktrace:

    TypeError: this.log is not a function
        at NJSTrace.inject (/home/jamie/code/renovate/node_modules/njstrace/njsTrace.js:73:7)
        at levels (/home/jamie/code/renovate/lib/logger/index.ts:129:5)
        at Object.parseConfigs (/home/jamie/code/renovate/lib/config/index.ts:70:3)
        at process._tickCallback (internal/process/next_tick.js:68:7)
        at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
        at Object.<anonymous> (/home/jamie/code/renovate/node_modules/@babel/node/lib/_babel-node.js:180:21)
        at Module._compile (internal/modules/cjs/loader.js:775:14)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
        at Module.load (internal/modules/cjs/loader.js:653:32)
        at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
        at Function.Module._load (internal/modules/cjs/loader.js:585:3)
        at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
        at startup (internal/bootstrap/node.js:283:19)
        at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3
    

    Here's my PR so far renovatebot/renovate#5632.

    Any suggestions or help would be greatly appreciated.

    opened by JamieMagee 3
  • How to trace ES6 Code call stack

    How to trace ES6 Code call stack

    I am interested in seeing how the callstack of my express app looks like, but when I plugged njstrace there, I am not getting any trace, but for my local modules, it is working.

    How to use for a full-fledged application.

    opened by arindam89 3
  • trace js code on each step of code execution along with storing the variables value change.

    trace js code on each step of code execution along with storing the variables value change.

    hey, this is an awesome project.

    I want to extend this project to trace javascript code on each step of the execution of code. here's an example to understand my requirements better,
    I've a simple js code that looks something like this,

    const add = (a, b) => {
        return a + b;
    }
    
    console.log(add(5, 4))
    

    I want to store the traced output in a JSON file, in structured data that should look something similar to this,

    [
        {
            "line_number": 1,
            "code_on_line": "const add = (a, b) => {",
            "variables": [
                {
                    "variable_name": "add",
                    "variable_value": "undefined"
                },
                {
                    "variable_name": "a",
                    "variable_value": "undefined"
                },
                {
                    "variable_name": "b",
                    "variable_value": "undefined"
                }
            ]
        },
        {
            "line_number": 5,
            "code_on_line": "console.log(add(5, 4))",
            "variables": [
                {
                    "variable_name": "add",
                    "variable_value": "(a, b) => { return a + b; }"
                }
            ]
        },
        {
            "line_number": 2,
            "code_on_line": "    return a + b;",
            "variables": [
                {
                    "variable_name": "a",
                    "variable_value": 5
                },
                {
                    "variable_name": "b",
                    "variable_value": 4
                }
            ]
        },
        {
            "line_number": 2,
            "code_on_line": "    return a + b;",
            "variables": [
                {
                    "variable_name": "a",
                    "variable_value": 5
                },
                {
                    "variable_name": "b",
                    "variable_value": 4
                },
                {
                    "variable_name": "Return value",
                    "variable_value": 9
                }
            ]
        },
        {
            "line_number": 5,
            "code_on_line": "console.log(add(5, 4))",
            "variables": [
                {
                    "variable_name": "add",
                    "variable_value": "(a, b) => { return a + b; }"
                }
            ]
        }
    ]
    

    ik this library works great for functions call and keeps track of the args and return values, how can I go about tracing the code execution step-by-step while keeping track of variables' values?

    thank you.

    opened by Ki6an 2
  • Problem with tracing node_modules

    Problem with tracing node_modules

    Hi, I have a problem trying to make njsTrace include the files inside of the node_modules folder. I have tried giving inject the following parameters: var njstrace = require('njstrace').inject({ files: ["**/*.js"], formatter: new TSVFormatter() }); Which should include all .js files; I also tried to include '**/node_modules/** in the files array. This should override the default negation and even when removing the default negation - it still does not work with the files inside of node_modules; only my own files are being traced.

    I would love to continue with njsTrace as part of bachelor project, so do you have any idea of why this does not work?

    opened by Arklaide 2
  • Support try/catch without error

    Support try/catch without error

    I had to change } catch { to } catch(error) { for this to start working again.

    This is valid javascript, I'm not sure which specific spec adds support but I've been using this with node 12 for quite some time.

    try {
        // Handler non fatal errors
        $injector.resolve('globalErrorHandler')(coreError);
    } catch {
        throw coreError;
    }
    
    > require('./app')
    njsTrace: Instrumenting: /usr/local/node/graphql-api/app/index.js
    njsTrace: ERROR: Error instrumenting file: /usr/local/node/graphql-api/app/index.js , Exception: { SyntaxError: Unexpected token (75:10)
        at Parser.pp$4.raise (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:2757:13)
        at Parser.pp.unexpected (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:647:8)
        at Parser.pp$1.parseTryStatement (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:1018:49)
        at Parser.pp$1.parseStatement (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:784:32)
        at Parser.pp$1.parseBlock (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:1112:23)
        at Parser.pp$3.parseFunctionBody (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:2600:22)
        at Parser.pp$3.parseArrowExpression (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:2561:8)
        at Parser.pp$3.parseExprAtom (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:2136:23)
        at Parser.pp$3.parseExprSubscripts (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:2047:19)
        at Parser.pp$3.parseMaybeUnary (/usr/local/node/graphql-api/node_modules/falafel/node_modules/acorn/dist/acorn.js:2024:17)
      pos: 1935,
      loc: Position { line: 75, column: 10 },
      raisedAt: 1936 }
    {}
    
    opened by OmgImAlexis 2
  • Won't parse spread operator

    Won't parse spread operator

    This library was failing to parse files that contain the spread operator. I fixed it by updating the ecmaVersion passed to falafel to 9. I can submit a PR if you want.

    opened by matthewgertner 2
  • Bump glob-parent from 5.1.1 to 5.1.2

    Bump glob-parent from 5.1.1 to 5.1.2

    Bumps glob-parent from 5.1.1 to 5.1.2.

    Release notes

    Sourced from glob-parent's releases.

    v5.1.2

    Bug Fixes

    Changelog

    Sourced from glob-parent's changelog.

    5.1.2 (2021-03-06)

    Bug Fixes

    6.0.0 (2021-05-03)

    ⚠ BREAKING CHANGES

    • Correct mishandled escaped path separators (#34)
    • upgrade scaffold, dropping node <10 support

    Bug Fixes

    • Correct mishandled escaped path separators (#34) (32f6d52), closes #32

    Miscellaneous Chores

    • upgrade scaffold, dropping node <10 support (e83d0c5)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
Owner
Yuval
Yuval
Dynamic tracing for javascript, in javascript (similar dtrace, ktap etc)

jstrace Dynamic tracing for JavaScript, written in JavaScript, providing you insight into your live nodejs applications, at the process, machine, or c

null 387 Oct 28, 2022
A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers

debug A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers. Installation $ npm ins

Sloth 10.5k Dec 30, 2022
An lldb plugin for Node.js and V8, which enables inspection of JavaScript states for insights into Node.js processes and their core dumps.

Node.js v10.x+ C++ plugin for the LLDB debugger. The llnode plugin adds the ability to inspect JavaScript stack frames, objects, source code and more

Node.js 1k Dec 14, 2022
Node is running but you don't know why? why-is-node-running is here to help you.

why-is-node-running Node is running but you don't know why? why-is-node-running is here to help you. Installation Node 8 and above: npm i why-is-node-

Mathias Buus 1.5k Dec 30, 2022
API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.

swagger-stats | API Observability https://swaggerstats.io | Guide Trace API calls and Monitor API performance, health and usage statistics in Node.js

slana.tech 773 Jan 4, 2023
thetool is a CLI tool to capture different cpu, memory and other profiles for your node app in Chrome DevTools friendly format

thetool thetool is a CLI tool to capture different cpu, memory and other profiles for your node app in Chrome DevTools friendly format. Quick start np

null 200 Oct 28, 2022
Node.js debugger based on Blink Developer Tools

Node Inspector Overview Node Inspector is a debugger interface for Node.js applications that uses the Blink Developer Tools (formerly WebKit Web Inspe

null 12.6k Dec 29, 2022
ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools

ndb ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools Installation Compatibility: ndb requires Node >=8.0.0. It works be

null 10.8k Dec 28, 2022
[OBSOLETE] runs Node.js programs through Chromium DevTools

devtool ⚠️ Update: This tool is mostly obsolete as much of the philosophy has been brought into Node/DevTool core, see here for details. If you wish t

Jam3 3.8k Dec 20, 2022
Debug Node.js code with Chrome Developer Tools.

Debug Node.js code with Chrome Developer Tools on Linux, Windows and OS X. This software aims to make things easier ?? . With ironNode you have the fu

Stephan Ahlf 2.3k Dec 30, 2022
🐛 Memory leak testing for node.

Leakage - Memory Leak Testing for Node Write leakage tests using Mocha or another test runner of your choice. Does not only support spotting and fixin

Andy Wermke 1.6k Dec 28, 2022
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

Matt Insler 815 Dec 23, 2022
Locus is a debugging module for node.js

ʆ Locus Locus is a debugging module which allows you to execute commands at runtime via a REPL. Installing npm install locus --save-dev Using require(

Ali Davut 300 Nov 13, 2022
He is like Batman, but for Node.js stack traces

Stackman Give Stackman an error and he will give an array of stack frames with extremely detailed information for each frame in the stack trace. With

Thomas Watson 242 Jan 1, 2023
Streamline Your Node.js Debugging Workflow with Chromium (Chrome, Edge, More) DevTools.

NiM (Node.js --inspector Manager) Streamlines your development process Google Chrome Web Store (works with any Chromium browsers: Google's Chrome, Mic

Will 188 Dec 28, 2022
📡 Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

?? Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

Cris 9 May 5, 2022
Well-formatted and improved trace system calls and signals (when the debugger does not help)

ctrace Well-formatted and improved trace system calls and signals (when the debugger does not help). Why? Awesome tools strace and dtruss have only on

Aleksandr Komlev 117 Dec 27, 2022
One-stop TLS traffic inspection and manipulation using dynamic instrumentation

hallucinate Author: Moritz Bechler [email protected] Project Repository: https://github.com/SySS-Research/hallucinate License: MIT Originally ins

SySS Research 215 Dec 16, 2022
A project to showcase a poc of distributed systems with message queue, graphql, grpc, http server with added monitoring and tracing capabilities.

trace-sandbox Trace sandbox is a project to showcase a poc of distributed systems with message queue, graphql, grpc, http server with added monitoring

Alfian Pramudita 6 Jun 24, 2021
An Amazon Kendra REST API CDK example with an API Gateway, including authentication with AWS Cognito and AWS X-Ray Tracing

Amazon Kendra Web Service CDK Sample Amazon Kendra has a robust JSON API for use with the AWS SDK (software development kit), but does not expose endp

AWS Samples 8 Nov 28, 2022