JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5966
  • Score
    100M100P100Q123951F

BitSet implementation for JavaScript

Package Exports

  • bitset

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bitset) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

BitSet

This module implements an array of bits, that grows as needed. It can be used from both JavaScript as well as CoffeeScript.

var bs = new BitSet();

_(12).times(function(n){ 
  bs.set(n);
});

console.dir(bs);

Mind you: The example uses underscore.js Usage

This is very useful for realtime metrics with for example Redis.

Installation

npm install bitset

Performance

It performs pretty well, you can try the performance.js in the support folder. This is the output with 100.000.000 bits:

set 100000000 bits: 3173ms
cardinality 100000000
cardinality: 949ms

Tests

Testing is done via the excellent mocha (cake test)