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

cassandra-map

v0.1.7

Published

A modern JSON implementation compatible with nearly all JavaScript platforms.

Readme

cassandraMAP

cassandraMAP Logo

CassandraMAP is a JavaScript implementation of Cassandra's Map type based on JSON3, compatible with a variety of platforms, including Internet Explorer 6, Opera 7, Safari 2, and Netscape 6. The current version is 0.1.0.

This code is based on JSON 3, created by bestiejs.

Apache Cassandra is an open-source distributed database managment system designed to handle large amounts of data. Within its query language, CQL, there is a map data type, which is equivalent to a JavaScript object. In order to query a database with CQL, a JavaScript object must be encoded into a JSON-like string that uses single quotes instead of the JSON standard double quotes. cassandraMAP provides a reliable, yet simple, way to encode objects into CQL-compilant map strings and decode them back to objects.

cassandraMAP exposes two functions: stringify() for serializing a JavaScript value to a CQL Map, and parse() for producing a JavaScript value from a CQL Map source string. Note: the links provided above are based on the JSON specification, and are provided only for reference purposes; cassandraMAP does not produce JSON-compilant results.

Portions of the date serialization code are adapted from the date-shim project.

Usage

Web Browsers

<script src="./path/to/cassandraMAP.js"></script>
<script>
  cassandraMAP.stringify({"key": "value"});
  // => "{'key':'value'}"
  cassandraMAP.parse("{'key':'value'}");
  // => {"key": "value"}
</script>

Asynchronous Module Loaders

Just like JSON 3, cassandraMAP is defined as an anonymous module for compatibility with RequireJS, curl.js, and other asynchronous module loaders.

<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.js"></script>
<script>
  require({
    "paths": {
      "cassandraMAP": "./path/to/cassandraMAP"
    }
  }, ["cassandraMAP"], function (cassandraMAP) {
    cassandraMAP.parse("[1, 2, 3]");
    // => [1, 2, 3]
  });
</script>

To avoid issues with third-party scripts, cassandraMAP is exported to the global scope even when used with a module loader.

CommonJS Environments

var cassandraMAP = require("./path/to/cassandraMAP");
cassandraMAP.parse("[1, 2, 3]");
// => [1, 2, 3]

JavaScript Engines

load("./path/to/cassandraMAP.js");
cassandraMAP.stringify({"Hello": 123, "Good-bye": 456}, ["Hello"], "\t");
// => "{\n\t'Hello': 123\n}"

Known Incompatibilities

  • Attempting to serialize the arguments object may produce inconsistent results across environments due to specification version differences. As a workaround, please convert the arguments object to an array first: cassandraMAP.stringify([].slice.call(arguments, 0)).

Required Native Methods

Just like JSON 3, cassandraMAP assumes that the following methods exist and function as described in the ECMAScript specification:

  • The Number, String, Array, Object, Date, SyntaxError, and TypeError constructors.
  • String.fromCharCode
  • Object#toString
  • Function#call
  • Math.floor
  • Number#toString
  • Date#valueOf
  • String.prototype: indexOf, charCodeAt, charAt, slice.
  • Array.prototype: push, pop, join.

Contribute

If you’d like to contribute a feature or bug fix, you can fork cassandraMAP, commit your changes, and send a pull request. Please make sure to update the unit tests in the test directory as well.

Alternatively, you can use the GitHub issue tracker to submit bug reports, feature requests, and questions, or send tweets to @jcoc611.

cassandraMAP is released under the MIT License.