npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cortec/cassandra

v1.7.3

Published

<description>

Readme

@cortec/cassandra

Module Overview

@cortec/cassandra provides a wrapper for connecting to Apache Cassandra clusters, supporting both standard and AWS SigV4 authentication. It manages multiple Cassandra clients, each identified by a unique name, and handles SSL configuration for secure connections.

This module is designed to be used within the Cortec framework, leveraging its configuration and lifecycle management.


Configuration Options

Where to put config: Place your Cassandra config in config/default.yml (or your environment-specific config file).

Schema:

cassandra:
  main:
    auth: 'aws' # "aws" for AWS SigV4, "default" for standard
    options:
      contactPoints:
        - 'cassandra.example.com'
      localDataCenter: 'us-east-1'
      caPath: '/path/to/ca.pem' # required for AWS SigV4
      keyspace: 'my_keyspace'
      # ...other cassandra-driver options
  analytics:
    auth: 'default'
    options:
      contactPoints:
        - 'analytics-db.example.com'
      localDataCenter: 'us-east-1'
      keyspace: 'analytics'

Field-by-field explanation:

  • cassandra: Root key for Cassandra config.
  • main, analytics: Identity/name for this Cassandra client (can be any string).
  • auth:
    • "aws": Use AWS SigV4 authentication (requires AWS credentials in environment).
    • "default": Use standard authentication.
  • options: Passed directly to the cassandra-driver client.
    • contactPoints: List of Cassandra node hostnames/IPs.
    • localDataCenter: Data center name for load balancing.
    • caPath: Path to CA certificate file (required for AWS SigV4).
    • keyspace: Default keyspace to use.
    • Any other valid cassandra-driver options.

How config is loaded: The config is loaded automatically by the @cortec/config module and validated at runtime. Access it in code via:

const config = ctx.provide<IConfig>('config');
const cassandraConfig = config?.get<any>('cassandra');

If config is missing or invalid, an error is thrown at startup.


Example Usage

import CortecCassandra from '@cortec/cassandra';

// Create the module instance
const cassandra = new CortecCassandra();

// After context is loaded, get a client by name
const client = cassandra.client('main');

// Use the client to execute queries
const result = await client.execute('SELECT * FROM my_keyspace.my_table');

// Shutdown all clients when disposing
await cassandra.dispose();

API

Methods

  • client(name: string): Client | undefined

    • Returns the Cassandra client for the given identity.
  • load(ctx: IContext)

    • Loads and connects all configured Cassandra clients.
  • dispose()

    • Shuts down all Cassandra clients.

Notes

  • For AWS SigV4 authentication, ensure your environment is configured with the necessary AWS credentials.
  • SSL options are required for secure connections, especially when using AWS.
  • All configuration is loaded via the Cortec config system.

References