Trace JavaScript/TypeScript code execution by automatically injecting network requests that report function calls to a local server, allowing you to track the flow of your code when running in the browser from the log file.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Front End Flow Tracker - JS/TS (FEFT) is a Visual Studio Code extension that helps you understand your code's execution flow by automatically inserting tracking statements at the beginning of all your JavaScript and TypeScript functions.
⚠️ Important Disclaimers:
This extension is intended for local development and debugging purposes only. It should not be commited or used in production environments.
Developers using this extension are solely responsible for its usage and any modifications made to their codebase. Please review all code changes before committing them.
It is strongly recommended to commit your changes before using this extension, as it will modify your source files.
The extension may modify your code formatting.
How It Works: Step-by-Step
1. Installation
Option A: Local Development
Clone the repository
git clone https://github.com/yourusername/front-end-flow-tracker.git
cd front-end-flow-tracker
Install dependencies
npm install
Run the extension by using "Run Extension" in the "Run and Debug" section of VS Code
Option B: VS Code Marketplace (Production)
Install extension directly the extension from the VS code marketplace
2. Adding Log Statements
Open your JS/TS project in VS Code
Run the command by pressing Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
Type "WTH: Add logs" and select it
Review and confirm the changes in the dialog
The extension will:
Scan your project files (only .js, .jsx, .ts, .tsx)
Parse each file using Babel
Inject network requests at the beginning of each function
Show a progress indicator during this process
3. What Gets Added to Your Code
The extension adds a simple fetch() call at the beginning of each function:
// Your original function
function calculateTotal(items) {
// Your code
}
// After WTH runs
function calculateTotal(items) {
fetch("http://localhost:3049/add-log", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ message: "abc123: path/to/file.js - calculateTotal" })
});
// Your code
}
4. How the Logs Are Collected
When you run the "WTH: Add logs" command, the extension starts a local HTTP server on port 3049
When you run your application, each function execution sends a log message to this server
The server:
Receives the log messages
Groups related function calls (those happening close together in time)
Marks each group with a distinct colored emoji (🔵, 🟣, 🟢, etc.)
Saves logs to a file in your project at frontEndFlowTracker/logs
5. Viewing the Execution Flow
Run your application normally after adding the logs