explaingit

clinicjs/node-clinic

5,949JavaScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

Clinic.js is a set of four Node.js performance profiling tools that diagnose why a server is slow, using too much CPU, leaking memory, or waiting too long on I/O, each producing a visual HTML report.

Mindmap

mindmap
  root((Clinic.js))
    Tools
      Doctor diagnose
      Flame CPU profile
      Bubbleprof async
      Heap Profiler memory
    What it finds
      CPU bottlenecks
      I/O wait
      Memory leaks
    How it works
      Wraps start command
      Collects while running
      Generates HTML report
    Install
      npm single command
      CLI usage
      Programmatic API
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

Diagnose the root cause of a slow Node.js server, CPU, I/O wait, or memory, using Clinic Doctor before diving deeper

USE CASE 2

Profile which functions burn the most CPU time in a Node.js app using Clinic Flame's flamegraph output

USE CASE 3

Track down memory leaks in a long-running Node.js service using the Heap Profiler

USE CASE 4

Analyze time spent waiting on database calls or file I/O using Clinic Bubbleprof's async visualization

Tech stack

JavaScriptNode.jsnpm

Getting it running

Difficulty · moderate Time to first run · 30min

Project is no longer actively maintained and results may be inaccurate on newer Node.js versions due to dependency on internal details.

In plain English

Clinic.js is a performance profiling toolkit for Node.js applications. It was originally built by NearForm, an open source consultancy, and it gives developers a way to spot why their Node.js server is running slowly, eating too much memory, or pausing unexpectedly. The project is no longer actively maintained, and because it depends heavily on Node.js internal details, results may not always be accurate on newer Node.js versions. The toolkit works by wrapping your normal server startup command. You run something like "clinic doctor -- node server.js", then send traffic to the server using a benchmarking tool, and finally shut the server down. Clinic.js collects data during that window and produces a visual report telling you what kind of problem it found: too much CPU work, slow input/output operations, memory issues, and so on. There are four separate tools inside the package. Doctor is the starting point: it diagnoses what category of problem you have and points you toward the right next tool. Bubbleprof focuses on time spent waiting for things like database calls or file reads. Flame shows you which functions in your code are consuming the most CPU time. Heap Profiler tracks memory allocation to help identify leaks. Installation is a single npm command, and the tools are used from the command line. Each tool also has a programmable interface for teams that want to automate profiling inside their own scripts or CI pipelines. There is a workaround documented for running the tools inside a Podman container, where an interactive prompt about usage statistics can cause the container to exit early: setting the NO_INSIGHT environment variable suppresses that prompt. The project supports Node.js version 16 and above. Full documentation and interactive demos are available on the clinicjs.org website, along with example repositories for each of the four tools.

Copy-paste prompts

Prompt 1
Walk me through using clinic doctor on my Express server: what command do I run, how do I send traffic, and how do I read the report?
Prompt 2
My Node.js API has high CPU usage, show me how to use clinic flame to generate a flamegraph and pinpoint the bottleneck function
Prompt 3
How do I use the clinic heap profiler to find which objects are accumulating in a long-running Node.js process?
Prompt 4
How do I run Clinic.js inside a Docker or Podman container and work around the interactive prompt that causes the container to exit early?
Prompt 5
How do I use the Clinic.js programmatic API to integrate profiling into my CI pipeline and fail the build if CPU usage exceeds a threshold?
Open on GitHub → Explain another repo

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

Verify against the repo before relying on details.