explaingit

nolanlawson/fuite

4,625JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A command-line tool that automatically finds memory leaks in web apps by opening Chrome, clicking through your pages repeatedly, and reporting which JavaScript objects, event listeners, DOM nodes, or collections keep growing with each pass.

Mindmap

mindmap
  root((fuite))
    What it does
      Detects memory leaks
      Automates browser testing
      Prints leak summary
    How it works
      Puppeteer drives Chrome
      Repeats user actions
      Heap snapshots per pass
    Leak types found
      JS objects
      Event listeners
      DOM nodes
      Arrays and maps
    Custom scenarios
      setup function
      iteration function
      teardown function
    Output
      Terminal summary
      JSON report file
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Find memory leaks in a single-page app by pointing it at a URL and watching which objects grow after repeated navigation

USE CASE 2

Write a custom scenario file to test whether opening and closing a modal leaks event listeners

USE CASE 3

Save a full JSON report to identify the exact line of code that registered a leaking event listener

USE CASE 4

Detect growing arrays or maps that are never cleared after repeated user interactions

Tech stack

JavaScriptNode.jsPuppeteerChrome

Getting it running

Difficulty · easy Time to first run · 5min

Requires Node.js, Puppeteer installs a bundled Chromium automatically.

License not described in the explanation.

In plain English

fuite (French for "leak") is a command-line tool that helps developers find memory leaks in web applications. Memory leaks happen when a browser holds onto data it should have freed, causing pages to grow slower or crash over time. This tool tries to catch those problems automatically, without requiring you to manually dig through browser profiling tools. You point fuite at a URL, and it opens Chrome in the background using Puppeteer, a browser automation library. By default, it finds links on your page, clicks each one, then hits the browser back button, and repeats this seven times. After each pass, it takes a snapshot of what is in memory. If the same types of objects keep growing with each repetition (exactly 7, 14, or 21 new instances), that is a strong signal that something is leaking rather than just temporarily allocated. Repeating a small prime number of times helps filter out coincidental noise. It looks for four categories of leaks: JavaScript objects captured through browser heap snapshots, event listeners that were never removed, DOM nodes still attached to the page, and collections like arrays, maps, and sets that keep growing without being cleared. After a run, it prints a summary to the terminal showing what leaked and by how much. For more complex apps, you can write a custom scenario file in JavaScript. The file exports functions (setup, iteration, teardown, and waitForIdle) that let you describe exactly what action to repeat during each test. An iteration might open a modal and close it, show a tooltip and dismiss it, or navigate to a page and come back. The only requirement is that the page ends up in the same state it started in, because multi-page apps do not accumulate memory the same way single-page apps do. An output flag saves a full JSON report with additional detail, including which line of code registered a leaking event listener. Other options let you adjust the number of iterations, pass extra arguments to Chrome, or run in debug mode.

Copy-paste prompts

Prompt 1
Using the fuite CLI, write a custom scenario file for my React SPA that opens a dialog and closes it each iteration, tell me what event listeners are leaking after 7 passes.
Prompt 2
Fuite found 14 new instances of MyComponent after each iteration in my Vue app. Help me trace what is preventing that component from being garbage collected.
Prompt 3
Write a fuite scenario file that navigates to a dashboard, sorts a data table, navigates back, and checks for leaking DOM nodes.
Prompt 4
Generate a shell script that runs fuite against a list of URLs, saves a JSON report for each, and prints a combined summary of all detected leaks.
Open on GitHub → Explain another repo

← nolanlawson on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.