This reminds me a lot of LokiJS[1], which, if I recall correctly, could optionally save the data as JSON file(s).
LokiJS has multiple persistence options, with JSON files in the filesystem being just one of them.
Alternatively, you could also just use it in-memory or with IndexedDB.