Skip to content

Instantly share code, notes, and snippets.

View JonathanXDR's full-sized avatar
🚀
Nie nöd am büglä → Never off the grind

Jonathan Russ JonathanXDR

🚀
Nie nöd am büglä → Never off the grind
View GitHub Profile
@JonathanXDR
JonathanXDR / extract-components.ts
Last active October 12, 2024 11:00
A Bun script, which extracts JavaScript modules and their dependencies from a bundle.
interface ModuleInfo {
[index: number]: [Function, { [key: string]: number }];
}
interface DependencyNode {
moduleId: number;
dependencies: DependencyNode[];
}
async function parseModules(jsContent: string): Promise<ModuleInfo> {