bitset32

High-performance, typesafe, small ordered set implemented in TypeScript

Usage no npm install needed!

<script type="module">
  import bitset32 from 'https://cdn.skypack.dev/bitset32';
</script>

README

bitset32

bitset32 License: GPLv3 Follow this project on Twitter

High-performance, typesafe, small ordered set (up to 32 members) implemented in TypeScript

bitset32 is specialized typesafe set implementation for use with TypeScript numeric enum types having a maximum of 32 members. The members of the set are defined by a TypeScript numeric enum object. A bitset32 instance is itself represented by the lower 32 bits of a JavaScript primitive number value. This representation is extremely compact compared to a regular JavaScript Object. Not only is the runtime space and time performance bitset32 superb but the elegant TypeScript implementation makes for a high-quality, typesafe alternative to otherwise tedious coding with number-based bit flags.

Note: No code has been released for this package yet. This is just the preliminary usage documentation.

Installation

$ npm install --save bitset32

As with most npm packages bitset32 may also be installed with other package managers such as yarn and pnpm.

License

GPLv3.

Copyright © 2019 Justin Johansson (https://github.com/indiescripter).