errors-bitfield
v1.0.1
Published
A bit less to write.
Downloads
3
Readme
errors-bitfield
A bit less to write.
The bitfield module lets you easily work with bitfield values, instead of working with actual bits, errors-bitfield
uses positions, Meaning that you only enable or disable positions and not bits.
Installation
yarn add errors-bitfield
Usage
// import
import Bitfield from "errors-bitfield";
const bits = new Bitfield();
bits.add(1, 3, 5);
console.log(bits.bit); // 21
bits.remove(5);
console.log(bits.bit); // 5