Peers and a first release

The Holster options config now support some more options from GunDB, including providing a peer as a string, or as an array, or as {peers: ["url", "etc"]} along with other options in an object. This also meant updating Holster's wire.js to support multiple WebSocket clients. I also added the server and port options from GunDB, all of which are required for real applications.

As I started converting existing code over to Holster I realised that set() would be nice to have. I decided to add it via put() rather than adding a new function, by using an extra parameter that converts the data you want to put to {"random-key": data}. That makes it a pretty simple change, since all updates are added to the set.

There is no map() in Holster to fetch the values in the set, but I'm finding that to be ok. More on how to convert code from GunDB to Holster later.

I've also added publishing new releases from github to npm, which required releasing the first version of Holster so v0.2.0 is now available!

Lex and npm

I've just added an initial version of Lex to Holster. It can only query properties on nodes at the moment, while I was working on it I had hopes that queries could be chained to do more interesting things, but that's going to be a lot of work! 😅

So for now lex needs to be added along with a callback for the data, not in a context chain. That allows queries like:

const nested = {
  key: "nested value",
  other: "other value"
}

holster.get("nested").put(nested, err => {
  holster.get("nested", {".": {"*": "k"}}, console.log)
  // logs: {key: "nested value"}
})

I think I'm also just ready to try using Holster from a real application and continue working on it as required from there. With that goal in mind I've also published Holster to npm! https://www.npmjs.com/package/@mblaney/holster

Time to switch gears and try building something with it.