# majority

> A two-bit library to get the most popular value

Latest version **1.0.3** (published 2021-04-13) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-04-13 |
| First published | 2021-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Vasily Zorin |
| Maintainers | kakserpom |

## Links

- npm: https://www.npmjs.com/package/majority
- Repository: https://github.com/kakserpom/majority.js
- Homepage: https://github.com/kakserpom/majority.js#readme
- Issues: https://github.com/kakserpom/majority.js/issues
- npm.io page: https://npm.io/package/majority

## Recent versions

- 1.0.3 (latest) — 2021-04-13
- 1.0.2 — 2021-04-13
- 1.0.1 — 2021-04-13
- 1.0.0 — 2021-04-13

## README

majority
=======
[![total downloads of majority](https://img.shields.io/npm/dt/majority.svg)](https://www.npmjs.com/package/majority)
[![majority's License](https://img.shields.io/npm/l/majority.svg)](https://www.npmjs.com/package/majority)
[![latest version of majority](https://img.shields.io/npm/v/majority.svg)](https://www.npmjs.com/package/majority)

*A two-bit library to get the most popular value.*

```js
(new Majority(1, 1, 2, 2, 2, 3, 3)).value()
// 2

const majority = new Majority()

console.log(majority.value('foo'))
// foo

for (let i = 0; i < 5; ++i) majority.feed('Trump')

console.log(majority.value())
// Trump

for (let i = 0; i < 10; ++i) majority.feed('Biden')

for (let i = 0; i < 6; ++i) majority.feed('Hilary')

console.log(majority.value())
// Biden

```

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