Library v2 for developers. Books are features, shelves are environments, librarian is tech lead, late fees are technical debt.
  • JavaScript 100%
Find a file
2026-06-30 11:15:21 +00:00
node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 test: add e2e tests 2026-06-28 11:11:35 +00:00
src feat(#1): library v2 engine — books, shelves, members, checkout, weeding, ASCII library 2026-06-16 12:08:51 +00:00
tests fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:15:18 +00:00
package.json feat(#1): library v2 engine — books, shelves, members, checkout, weeding, ASCII library 2026-06-16 12:08:51 +00:00
README.md feat(#1): library v2 engine — books, shelves, members, checkout, weeding, ASCII library 2026-06-16 12:08:51 +00:00

code-library-v2

Library v2 for developers. Books are features, shelves are environments, librarian is tech lead, late fees are technical debt.

Usage

const { Library, GENRES } = require('./src/library');

const lib = new Library('Dev Public Library');
lib.setLibrarian('Giles');

// Acquire books (add features)
lib.acquireBook('Auth Guide', GENRES.REFERENCE, 'Dev Shelf');
lib.acquireBook('React Magic', GENRES.FANTASY, 'Production Shelf');

// Register members (users)
lib.registerMember('Alice', 'vip');

// Checkout (adopt features)
lib.checkoutBook('Auth Guide', 'Alice', 'Dev Shelf');

// Time passes
for (let i = 0; i < 20; i++) lib.tick();

// Return (with late fees = tech debt)
lib.returnBook('Auth Guide', 'Alice', 'Dev Shelf');

// Weed old features
lib.weed('Dev Shelf');

console.log(lib.libraryView());
console.log(lib.report());

Genres

  • Reference (Documentation) — API docs, runbooks
  • Fantasy (New Framework) — Magical promises
  • Horror (Legacy Code) — Checks itself out at night
  • Mystery (Undocumented Feature) — Nobody knows how it works
  • Textbook (Architecture) — Dense, dusty
  • Comic (Quick Hack) — Fast, fun, disposable
  • Poetry (Clean Code) — Beautiful, misunderstood
  • Encyclopedia (Monolith) — Contains everything, finds nothing

Shelves

  • Dev Shelf (cap 15) — Development features
  • Staging Shelf (cap 20) — Testing features
  • Production Shelf (cap 30) — Live features
  • Archive (cap 50) — Deprecated features