0.0.23 • Published 7 months ago

@polyscale/polyscale-node v0.0.23

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

@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.

0.0.23

7 months ago

0.0.22

11 months ago

0.0.21

11 months ago

0.0.20

11 months ago