Skip to content

Instantly share code, notes, and snippets.

View IdrisAkintobi's full-sized avatar
💻
Developing...

Idris Akintobi IdrisAkintobi

💻
Developing...
View GitHub Profile
@IdrisAkintobi
IdrisAkintobi / take-memory-snapshot.ts
Last active April 17, 2025 19:21 — forked from amirilovic/take-memory-snapshot.ts
A script that save heap snapshot from a nodejs process in debug mode to a file
import fs from "fs";
import { WebSocket } from "ws";
async function getWebSocketDebuggerUrl() {
const res = await fetch("http://localhost:9229/json");
const data = await res.json();
return data[0].webSocketDebuggerUrl;
}
let ws: WebSocket;