1.0.1 • Published 5 years ago

errors-bitfield v1.0.1

Weekly downloads
3
License
UNLICENSED
Repository
-
Last release
5 years ago

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