API Reference

Cassandra Node.js Driver

DataStax Node.js driver for Apache Cassandra with prepared statements, paging, and auth support.

Official Documentation ↗
CompatibilityThis documentation covers version v4.7. Check the official docs for the latest API surface.

Installation

npmnpm install cassandra-driver

Methods

The driver exposes Client and BatchStatement APIs and routes requests to the correct node via token metadata.

Key Features

  • Prepared statements with automatic caching
  • Paging and paging state tokens
  • Local quorum and consistency levels

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

FAQ

What is a prepared statement?
A statement parsed once by the cluster and cached by the driver. Pass prepare: true so parameters are bound efficiently and safely.
How do I page large results?
Set fetchSize and read pageState from the ResultSet to fetch subsequent pages on demand instead of loading everything.
Which consistency level should I use?
LOCAL_QUORUM is a common default for multi-datacenter clusters; lower it only when you accept weaker guarantees.