The package is meant to allow the creation and usage of key-value store in Google App Script applications.
The package allows create basic managed (handling serialization and deserialization) KV store using Properties, Spreadsheets, Documents, etc.
It is possible to create a KV store from a property store:
const kv = createPropertiesStore(PropertiesService.getDocumentProperties());
kv.set("obj", { name: "test", value: 10 });
console.log(kv.get("obj").value);
It is possible to create a KV store from a cache:
const kv = createCacheStore(CacheService.getDocumentCache());
kv.set("obj", { name: "test", value: 10 });
console.log(kv.get("obj").value);
It is possible to create a KV store from a Spreadsheet range:
const kv = createSpreadsheetStore(
SpreadsheetApp.getActive()
.getRange("B1:C1")
.getDataRegion(SpreadsheetApp.Dimension.ROWS)
);
kv.set("obj", { name: "test", value: 10 });
console.log(kv.get("obj").value);
Have a look to the e2e test.