@hiveops/apiary
v0.0.12
Published
JS client for Apiary Cache Server
Downloads
5
Readme
JavaScript client for Apiary cache server
Installation
npm install @hiveops/apiary
# or
deno add @hiveops/apiary
Usage
import { Entry, getClient } from '@hiveops/apiary';
const client = getClient({
baseUrl: "http://localhost:2468",
});
const entries: Entry[] = [
new Entry({
key: "key1",
value: textEncoder.encode("value1"),
}),
new Entry({
key: "key2",
value: textEncoder.encode("value2"),
}),
];
const setEntryResponse = await client.setEntries({
keyspace,
entries,
});
console.log(setEntryResponse);
const getEntriesResponse = await client.getEntries({
keyspace,
keys: entries.map((entry) => entry.key),
});
console.log(getEntriesResponse);