bits
Usage
If you're using Node.js type:
npm install --save bits
Then load the module:
var bits = require("bits");
If you'd like to use it in your browser application, just link the JS file:
<script src="bits.js"></script>
You can also use script loaders like require.js:
define(["./bits"], function(bits){ });
Now here is the API:
var data = 0;
data = bits.set(data, 2);
data = bits.set(data, [0,3,7]);
data = bits.clear(data, 1);
data = bits.clear(data, 1, 5);
data = bits.toggle(data, 5);
data = bits.test(data, 6);
data = bits.get(data, 6);
Test
npm test
License
MIT license