Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Official JS/TS client library for Rockset.
npm i rockset
Supports ES6 promises and TS types out of the box.
If you are looking for the old Rockset client, you can find it at branch v1
ES6 node or Webpack. Typescript in order to get types support.
const rockset = require("rockset").default(apikey, "https://api.rs2.usw2.rockset.com");
await rockset.queries.query({
sql: { query: "Select count(*) from _events" }
});
import rocksetConfigure from "rockset";
const rockset = rocksetConfigure(apikey, "https://api.rs2.usw2.rockset.com");
await rockset.queries.query({
sql: { query: "Select count(*) from _events" }
});
To supply a custom fetch function, we pass it in as the last parameter to rocksetConfigure.
This example shows how to configure a custom fetch function with axios's promise cancellation feature.
Note this does not cancel the api request on Rockset's servers
import axios from "axios";
import rocksetConfigure from "rockset";
// Super simple fetch with axios: axios docs show how to check for errors, cancel requests etc.
const customFetchAxios = async (url: string, {
headers,
method,
body: data,
queryParams: params,
cancelToken
}:any) => {
const res = await axios.request({
url,
headers,
method,
data,
params,
cancelToken
});
return res.data;
};
// Configure
const basePath = "https://api.rs2.usw2.rockset.com";
const apikey = "<your apikey>";
const rockset = rocksetConfigure(apikey, basePath, customFetchAxios);
const cancelSource = axios.CancelToken.source();
// To execute a query
rockset.queries
.query(
{ sql: { query: "Select count(*) from _events" } },
{ cancelToken: cancelSource.token }
)
.then(console.log)
.catch(console.error);
// To cancel the request through axios
// *** THIS DOES NOT CANCEL THE QUERY ON OUR SERVERS ***
cancelSource.cancel();
You can see a few more sample examples of how to create a collection, how to put documents in a collection and how to use SQL to query your collections.
Unit tests are available in the Test folder.
Set ROCKSET_APIKEY and ROCKSET_APISERVER endpoint in the environment variables. To run tests:
npm test
This runs unit tests and integration tests.
Feel free to log issues against this client through GitHub.
The Rockset Node Client is licensed under the Apache 2.0 License
FAQs
Client for querying Rockset and interacting with the Rockset API.
The npm package rockset receives a total of 31 weekly downloads. As such, rockset popularity was classified as not popular.
We found that rockset demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.