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

cassandrom

v0.0.4

Published

Cassandra JavaScript ORM

Readme

Cassandrom

Cassandrom is a Cassandra object modeling tool for Node JS (like mongoose).

Installation

Install node.js and cassandra

$ npm install cassandrom

Connecting to Cassandra

To use cassandrom first create connection.

var cassandrom = require('cassandrom');

cassandrom.createConnection({ contactPoints: [
  'localhost'
  // , 'another-host',
  ], localDataCenter: 'datacenter1', keyspace: 'keyspace'});

Defining a Schema

var schema = new cassandrom.Schema({
  userId:   { type: cassandrom.UUIDType, required: true, default: cassandrom.uuid },
  fullName: { type: String, required: true, trim: true },
  username: { type: String, required: true, unique: true, trim: true },
  email:    { type: String, required: true, unique: true, trim: true },
  password: { type: String, required: true },
  date:     { type: Date, default: Date.now, required: true }

}, ['userId']);

Get Model and Start work

var User = cassandrom.model("User", schema);

Create and save Model

User.create({
  fullName: 'John Doe',
  username: 'john',
  email: '[email protected]',
  password: 'doedoe'
}, function (error, user) {
  if(error) {
    console.log('Error during user save: ' + error);
  } else {
    console.log('User saved ' + user.userId + ' date ' + user.date);
  }
});

Searching

Find all records match the certain field.

User.find({ username: name }, function(error, results) {
  console.log('Find ' + results.length + ' users');
});

Find only one record.

User.findOne({ username: name }, function(error, user) {
  console.log('Find found ' + user);
});

Add New Methods

schema.statics.findByUserame = function(name, callback) {
  this.findOne({ username: name }, callback);
};

schema.statics.findById = function(id, callback) {
  this.findOne({ userId: id }, callback);
};

Promise

User.findOne({ username: name })
    .then(function(user)) {

    }
    .catch(function(error) {

    });

ES6

const user = await aUser.findOne({ username: name });

Cassandra Driver access

DataStax nodejs-driver for Apache Cassandra were used.

Creators

Kiril Menshikov - https://twitter.com/kiril

Copyright and license

Code released under the Apache 2.0 license.