Library v2 for developers. Books are features, shelves are environments, librarian is tech lead, late fees are technical debt.
- JavaScript 100%
| node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 | ||
| src | ||
| tests | ||
| package.json | ||
| README.md | ||
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