Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@cubejs-client/core
Advanced tools
@cubejs-client/core is a JavaScript client for Cube.js, an open-source analytical API platform. It allows developers to query and interact with Cube.js to build analytical applications. The package provides functionalities for querying data, managing sessions, and handling real-time updates.
Querying Data
This feature allows you to query data from Cube.js. The code sample demonstrates how to load data with specific measures, time dimensions, and other dimensions.
const cubejs = require('@cubejs-client/core');
const cubejsApi = cubejs('YOUR-CUBEJS-API-TOKEN');
cubejsApi.load({
measures: ['Orders.count'],
timeDimensions: [{
dimension: 'Orders.createdAt',
dateRange: ['2020-01-01', '2020-12-31']
}],
dimensions: ['Orders.status']
}).then(resultSet => {
console.log(resultSet.tablePivot());
});
Managing Sessions
This feature allows you to manage sessions with Cube.js. The code sample shows how to request a session and log the session ID.
const cubejs = require('@cubejs-client/core');
const cubejsApi = cubejs('YOUR-CUBEJS-API-TOKEN');
cubejsApi.requestSession().then(session => {
console.log('Session ID:', session.id);
});
Handling Real-Time Updates
This feature allows you to handle real-time updates from Cube.js. The code sample demonstrates how to subscribe to data changes and handle updates using a callback function.
const cubejs = require('@cubejs-client/core');
const cubejsApi = cubejs('YOUR-CUBEJS-API-TOKEN');
cubejsApi.subscribe({
measures: ['Orders.count'],
timeDimensions: [{
dimension: 'Orders.createdAt',
dateRange: ['2020-01-01', '2020-12-31']
}],
dimensions: ['Orders.status']
}, {
onNext: (resultSet) => {
console.log(resultSet.tablePivot());
}
});
graphql-request is a minimal GraphQL client for Node.js and browsers. It allows you to send GraphQL queries and mutations in a simple and straightforward way. Compared to @cubejs-client/core, graphql-request is more general-purpose and can be used with any GraphQL API, not just Cube.js.
axios is a promise-based HTTP client for the browser and Node.js. It can be used to make HTTP requests to any API, including REST and GraphQL endpoints. While axios is not specifically designed for analytical queries, it provides a flexible way to interact with various APIs, including Cube.js.
apollo-client is a comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL. It is more feature-rich compared to @cubejs-client/core and is designed to work with any GraphQL server, providing advanced caching and state management capabilities.
Website • Docs • Blog • Slack • Twitter
Cube.js Client core set of methods to access Cube.js API Gateway.
Cube.js Client Core is MIT licensed.
0.36.2 (2024-09-18)
[I]LIKE ... ESCAPE ...
SQL push down (2bda0dd)FAQs
cube.js client
The npm package @cubejs-client/core receives a total of 124,358 weekly downloads. As such, @cubejs-client/core popularity was classified as popular.
We found that @cubejs-client/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.