@jswork/bitwise-permission-manager
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

bitwise-permission-manager

Bitwise permission manager.

version license size download

installation

npm install @jswork/bitwise-permission-manager

usage

import bpm from '@jswork/bitwise-permission-manager';

let r = 0b100;
let w = 0b010;
let x = 0b001;
let target = 0b111;

// add
let p = bpm.add(r, w, x);                // 0b111
// remove
let p = bpm.remove(target, r, w, x);            // 0b000
// toggle
let p = bpm.toggle(target, r, w, x);    // 0b000
// has
let p = bpm.has(target, r, w, x);       // true

license

Code released under the MIT license.

Package Sidebar

Install

npm i @jswork/bitwise-permission-manager

Homepage

js.work

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

7.53 kB

Total Files

6

Last publish

Collaborators

  • afeiship