Initial project outline
- package.json (ESM, bin entry) - bin/delta-backup.js — entrypoint - lib/args.js — CLI arg parsing via Node parseArgs - lib/config.js — config file merging + required path guards - lib/spawn.js — safe process spawning (no shell strings) - lib/state.js — sequence number + phase state management - lib/backends/zstd.js — zstd delta backend - lib/backends/index.js — backend registry - lib/commands/run.js — full run skeleton (phases 1-3 wired, 4-6 stubbed) - lib/commands/status.js — status command
This commit is contained in:
12
lib/backends/index.js
Normal file
12
lib/backends/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import * as zstd from './zstd.js';
|
||||
|
||||
const BACKENDS = { zstd };
|
||||
|
||||
export function getBackend(name) {
|
||||
const backend = BACKENDS[name];
|
||||
if (!backend) {
|
||||
console.error(`Unknown backend: ${name}. Available: ${Object.keys(BACKENDS).join(', ')}`);
|
||||
process.exit(1);
|
||||
}
|
||||
return backend;
|
||||
}
|
||||
Reference in New Issue
Block a user