How emmercm/igir works
Igir is a command-line ROM collection manager. The principal workflow is to accept commands and input/DAT options, scan ROMs and archives against DAT metadata, form and validate output candidates, then write or test results and generate reports or playlists. The README also documents directory-to-DAT, fixdat, cleanup, patching, filtering, and MAME set operations, represented as capability branches. Relationships involving unsampled modules are omitted or marked unverified; the sampled excerpts do not reveal the complete orchestration.
Main entry points: igir.ts Run orchestrator · index.ts CLI entry · file.ts File model · argumentsParser.ts Argument parser
Components 29
CLI and orchestration
- CLI entry
index.ts - Argument parser
src/modules/argumentsParser.ts - Run options
src/models/options.ts - Run orchestrator
src/igir.ts - Logging
src/console/logger.ts
DAT and ROM catalog
- DAT models
src/models/dats/dat.ts - DAT processing
src/modules/dats - DAT scanner
src/modules/dats/datScanner.ts - ROM scanning
src/modules/roms/romScanner.ts - File model
src/models/files/file.ts - Archive entries
src/models/files/archives/archiveEntry.ts - Checksums
src/models/files/fileChecksums.ts - File factory
src/factories/fileFactory.ts - File cache
src/cache/fileCache.ts
ROM processing
- Candidate generation
src/modules/candidates/candidateGenerator.ts - Candidate validation
src/modules/candidates/candidateValidator.ts - Patch processing
src/modules/candidates/candidatePatchGenerator.ts - ROM processing
src/modules/roms - ZIP support
packages/zip/src/zipReader.ts - Torrent ZIP
packages/torrentzip/src/tzWriter.ts - Archive format add-ons
addons
Outputs and reporting
- Candidate writer
src/modules/candidates/candidateWriter.ts - Playlist creation
src/modules/playlistCreator.ts - Status generation
src/modules/statusGenerator.ts - Report generation
src/modules/reportGenerator.ts - Directory to DAT
src/modules/dir2DatCreator.ts - Fixdat creation
src/modules/fixdatCreator.ts - Output cleanup
src/modules/cleaners
Other components
- CLI user
Connections 26
- CLI user → CLI entry: runs
- CLI entry → Argument parser: parses commands
index.ts - CLI entry → Run orchestrator: starts run
index.ts - Argument parser → Run options: configures
src/modules/argumentsParser.ts - Run orchestrator → DAT scanner: processes DATs
- DAT scanner → DAT models: loads
- DAT processing → DAT models: merges and filters
- Run orchestrator → Candidate generation: generates candidates
src/igir.ts - Run orchestrator → Playlist creation: writes playlists
src/igir.ts - Run orchestrator → Status generation: generates status
src/igir.ts - Run orchestrator → Report generation: generates report
src/igir.ts - Run orchestrator → Patch processing: generates patched candidates
src/igir.ts - ROM scanning → File factory: creates file objects
- File factory → File model: constructs files
src/factories/fileFactory.ts - File model → Checksums: calculates hashes
src/models/files/fileChecksums.ts - Archive entries → Checksums: calculates entry hashes
src/models/files/archives/archiveEntry.ts - File cache → File model: restores cached file
src/cache/fileCache.ts - Candidate generation → Candidate validation: validates candidates
- Run orchestrator → Candidate writer: writes outputs
src/igir.ts - Run orchestrator → ROM processing: processes ROMs
- Run orchestrator → Directory to DAT: creates DAT
- Run orchestrator → Fixdat creation: creates fixdat
- Run orchestrator → Output cleanup: cleans output
src/igir.ts - ZIP support → Torrent ZIP: supports validation
- Run orchestrator → Archive format add-ons: supports archive formats
src/igir.ts - CLI entry → Logging: uses logging
index.ts