diff --git a/deno.json b/deno.json index 072f1a1..dfafdef 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@bearmetal/store", - "version": "0.0.2", + "version": "0.0.3", "description": "A simple store for storing data in a JSON file.", "files": [ "mod.ts", diff --git a/store.ts b/store.ts index bf4e3a7..6754310 100644 --- a/store.ts +++ b/store.ts @@ -77,7 +77,7 @@ export class BearMetalStore { } private readIn() { - this.store = JSON.parse(Deno.readTextFileSync(this.storePath)); + this.store = JSON.parse(Deno.readTextFileSync(this.storePath) || "{}"); } private writeOut() {