Socket
Book a DemoInstallSign in
Socket

@datawheel/tesseract-client

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datawheel/tesseract-client

A javascript client to fetch and work with entities from a tesseract-olap server.

latest
Source
npmnpm
Version
0.4.3
Version published
Maintainers
3
Created
Source

tesseract-client Build Status

A javascript client to fetch and work with entities from a tesseract-olap server. Heavily inspired by the mondrian-rest-client project, but with some added functionality.

Installation

npm install @datawheel/tesseract-client

Usage

The main classes you will want to use are Client and MultiClient.

import {Client as TesseractClient} from "@datawheel/tesseract-client";

const client = new TesseractClient(SERVER_URL);

MultiClient is a wrapper around the Client class, which allows you to use the same public methods as Client but with multiple remote servers at once.

import {MultiClient} from "@datawheel/tesseract-client";

const client = new MultiClient([SERVER1_URL, SERVER2_URL]);

Notice that MultiClient can accept a string or an array, while Client just accepts a string. If you intend to work with only one tesseract-olap server, you can use both classes, but Client will perform better.

All methods in the Client classes return a Promise for the item you are requesting. You can use .then() chaining or the async/await combo to work with the returned objects:

function getAllCubeNames(client) {
  return client.cubes().then(cubes => cubes.map(cube => cube.name));
}

async function getAllCubeNames(client) {
  const cubes = await client.cubes();
  return cubes.map(cube => cube.name);
}

We have a migration guide for users of mondrian-rest-client. The package also exports TypeScript definitions for most of the classes used.

Keywords

dataset

FAQs

Package last updated on 19 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts