Skip to content

hive-ops/js-apiary

Repository files navigation

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);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published