Registry / analytics / mondrian-rest-client

mondrian-rest-client

JSON →
library1.1.4jsnpmunverified

A JavaScript/TypeScript client library for mondrian-rest, an OLAP server. Version 1.1.4, last updated in 2019, appears to be in maintenance mode. Provides a fluent query builder for cube exploration (dimensions, measures, drilldowns). Ships TypeScript types. Not actively developed; limited documentation.

npm install mondrian-rest-client
INSTALL
IMPORT
SIG · MONDRIAN-REST-CLIE
M
mondrian-rest-client
analyticsjavascriptv1.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
import { Client } from 'mondrian-rest-client'
import Client from 'mondrian-rest-client'
Named export, not default.
Client
const { Client } = require('mondrian-rest-client')
const Client = require('mondrian-rest-client')
CommonJS require destructuring.
Query
import { Query } from 'mondrian-rest-client'
import { QueryBuilder } from 'mondrian-rest-client'
The query builder class is named Query, not QueryBuilder.

This example demonstrates creating a MongoDB client, fetching a cube, building a query with drilldowns and measures, executing it, and handling the result.

import { Client } from 'mondrian-rest-client'; async function run() { const client = new Client('http://example.com/mondrian'); const cube = await client.cube('Sales'); const query = cube.query .drilldown('Geography', 'Country') .drilldown('Time', 'Year') .measure('Revenue'); const data = await client.query(query); console.log(data); } run().catch(console.error);
Debug
Known issues
gotchaThe Client constructor expects a base URL without a trailing slash; appending one may cause double slashes in requests.
fix
Provide base URL like 'http://example.com/mondrian' without trailing slash.
affects: >=1.0.0
deprecatedThe library relies on the 'node-fetch' polyfill internally; newer Node.js versions have native fetch, but this package does not use it.
fix
Monitor for updates; consider wrapping calls with native fetch if needed.
affects: >=1.0.0
breakingVersion 1.0.0 changed the API from callback-based to promise-based; old callback patterns are not supported.
fix
Use async/await or .then() instead of callbacks.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'node-fetch'
Missing dependency when using in Node.js environment that does not have native fetch.
fix
Install node-fetch: npm install node-fetch
Uncaught TypeError: client.cube is not a function
Importing the default export instead of named export { Client }.
fix
Change import statement to: import { Client } from 'mondrian-rest-client'
TypeError: Cannot read property 'query' of undefined
Trying to call .query on an undefined cube object due to failed cube fetch.
fix
Ensure the base URL is correct and the mondrian-rest server is running.
Upgrade
Version history
1.1.4latest on npm
Audit
Dependencies
node-fetchoptionalUsed for HTTP requests in Node.js environment
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources