()
| 50 | } |
| 51 | |
| 52 | initFromFileSync() { |
| 53 | // Read config file. |
| 54 | let config = {version: CONFIG_VERSION}; |
| 55 | try { |
| 56 | config = fs.readJsonSync(this.#file); |
| 57 | } catch (e) { |
| 58 | if (e.code != 'ENOENT') // ignore file not exist error |
| 59 | throw e; |
| 60 | } |
| 61 | this.deserialize(config); |
| 62 | this.initialized = true; |
| 63 | } |
| 64 | |
| 65 | async saveToFile() { |
| 66 | if (this.inMemory || !this.initialized) |
no test coverage detected