✏ README, fix start-once bug and refactor

- Added some configuration and running to README
- Refactored some code
- Fixed exception when stopping a start-once script
- Only allow running with pnpm
- Moved transactions into sparebank1Api.ts
- Formatted
This commit is contained in:
2025-01-25 22:30:52 +01:00
parent 4977e7ad6a
commit 2e73baf98b
9 changed files with 91 additions and 57 deletions

View File

@ -22,6 +22,7 @@ export const BANK_ACCOUNT_IDS = getArrayOrThrow("BANK_ACCOUNT_IDS")
export const DB_FILENAME = getOrDefault("DB_FILENAME", "default")
export const LOG_LEVEL = getOrDefault("LOG_LEVEL", "info")
// Utility functions
function getOrDefault(key: string, def: string): string {
return process.env[key] || def
}