# bits

> Easy bit manipulation

Latest version **0.1.1** (published 2013-12-12) · 0 weekly downloads

## Install

```sh
npm install bits
pnpm add bits
yarn add bits
bun add bits
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2013-12-12 |
| First published | 2012-12-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Markus Kohlhase |
| Maintainers | flosse |

## Links

- npm: https://www.npmjs.com/package/bits
- Repository: https://github.com/flosse/bits
- Issues: https://github.com/flosse/bits/issues
- npm.io page: https://npm.io/package/bits

## Recent versions

- 0.1.1 (latest) — 2013-12-12
- 0.1.0 — 2013-10-18
- 0.0.0 — 2012-12-05

## README

# bits

[![Build Status](https://secure.travis-ci.org/flosse/bits.png)](http://travis-ci.org/flosse/bits)
[![Dependency Status](https://gemnasium.com/flosse/bits.png)](https://gemnasium.com/flosse/bits)
[![NPM version](https://badge.fury.io/js/bits.png)](http://badge.fury.io/js/bits)

## Usage

If you're using Node.js type:

```shell
npm install --save bits
```

Then load the module:

```javascript
var bits = require("bits");
```

If you'd like to use it in your browser application, just link the JS file:

```html
<script src="bits.js"></script>
```

You can also use script loaders like require.js:

```javascript
define(["./bits"], function(bits){ /* .. */ });
```

Now here is the API:

```javascript
var data = 0;
data = bits.set(data, 2);
data = bits.set(data, [0,3,7]); // set bit 0, 3 and 7
data = bits.clear(data, 1);
data = bits.clear(data, 1, 5);  // clear bit 1,3,4,5
data = bits.toggle(data, 5);
data = bits.test(data, 6);      // returns true or false
data = bits.get(data, 6);       // returns 0 or 1
```

## Test

    npm test

## License

MIT license

---
_Source: https://npm.io/package/bits · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
