The DataStax Node.js Driver for Apache Cassandra is a modern feature-rich and highly tunable Node.js client library for Apache Cassandra (1.2+) and DataStax Enterprise (3.1+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3.
Getting started
A Client
instance maintains multiple connections to the cluster nodes and uses policies to determine
which node to use as coordinator for each query, how to handle retry and failover.
Client
instances are designed to be long-lived and usually a single instance is enough per application.
const cassandra = require('cassandra-driver');
const client = new cassandra.Client({ contactPoints: ['host1'] });
client.execute('SELECT key FROM system.local', function (err, result) {
assert.ifError(err);
const row = result.first();
console.log(row['key']);
});
See Client class documentation
.