@polyscale/polyscale-node
v0.0.23
Published
Client for interacting with the PolyScale API.
Downloads
1
Readme
@polyscale/polyscale-node
Client for interacting with the PolyScale API.
Example Usage
import PolyScale from "@polyscale/polyscale-node";
const polyscale = new PolyScale({
url: "https://url-to-api.com",
apiKey: "some-api-key",
});
/**
* Basic usage
*/
polyscale.cache
.create({
name: "Example Cache",
host: "localhost",
port: 4000,
workspaceId: "some-id",
})
.then((cache) => {
console.dir(cache);
polyscale.cacheTtl.create(cache.id, {
type: "TABLE",
value: 5,
key: "tableA",
});
})
.catch((error) => {
console.error(error);
});
/**
* Using Async/Await
*/
const init = async () => {
try {
const cache = await polyscale.cache.create({
name: "Example Cache",
host: "localhost",
port: 4000,
workspaceId: "some-id",
});
console.dir(cache);
await polyscale.cacheTtl.create(cache.id, {
type: "TABLE",
value: 5,
key: "tableA",
});
} catch (error) {
console.error(error);
}
};
init();
License
polyscale-node is MIT licensed.