Black hole for developers. Event horizon = prod boundary, singularity = null pointer, accretion disk = logs spinning forever.
  • JavaScript 100%
Find a file
2026-06-30 11:13:03 +00:00
node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:13:00 +00:00
src feat(#1): black hole engine — singularity, accretion disk, event horizon, spaghettification 2026-06-15 01:08:43 +00:00
tests fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:13:00 +00:00
package.json feat(#1): black hole engine — singularity, accretion disk, event horizon, spaghettification 2026-06-15 01:08:43 +00:00
README.md feat(#1): black hole engine — singularity, accretion disk, event horizon, spaghettification 2026-06-15 01:08:43 +00:00

code-blackhole

Black hole for developers. Event horizon = prod boundary, singularity = null pointer, accretion disk = logs spinning forever.

Usage

const { BlackHole, ITEMS } = require('./src/blackhole');
const { SINGULARITY_TYPES } = require('./src/singularity');

const bh = new BlackHole('Sagittarius A*');

// Form a singularity
bh.form(SINGULARITY_TYPES.MEMORY_LEAK);

// Attract items (bugs, features, dependencies, tech debt...)
bh.attract(ITEMS.BUG);
bh.attract(ITEMS.DEPENDENCY);
bh.attract(ITEMS.TECH_DEBT);

// Time passes
bh.tick();
bh.advanceDay();

// Spaghettify code
const stretched = bh.spaghettify('const x = getData().then(r => r.json())');

// Visualize
console.log(bh.visualize());
console.log(bh.report());

Singularity Types

  • Null Pointer Exception (mass 50) — Deref nothing into everything
  • Infinite Loop (mass 70) — while(true) { entropy++; }
  • Stack Overflow (mass 60) — Recursive calls without base case
  • Memory Leak (mass 80) — malloc without free, nothing released
  • Division by Zero (mass 30) — Math breaks, NaN propagates
  • Deadlock (mass 65) — Two threads waiting forever

Components

  • Singularity — 6 types with mass/energy/density, grows by consuming items, Hawking radiation
  • AccretionDisk — Log entries spinning, heating up, getting consumed over time
  • BlackHole — Full system: gravitational pull, event horizon, spaghettification, escape attempts