Skip to content

Node.js

@spark-connect-js/node is the reference runtime adapter. It provides the gRPC transport (via @grpc/grpc-js), the Arrow IPC decoder (via apache-arrow), and re-exports the full public API from @spark-connect-js/core. For application code this is the only package you install.

Terminal window
npm install @spark-connect-js/node
import { connect } from "@spark-connect-js/node";
const spark = connect("sc://localhost:15002");
const rows = await spark.sql("SELECT 1 AS n").collect();
console.log(rows);
await spark.stop();

See the Quickstart for a full walkthrough and the API reference for every exported symbol.

  • Node.js 22 or later.
  • A reachable Spark Connect server (Spark 3.4 or newer).