# elo-js

> Quick and dirty Elo algorithm implementation in JS.

Latest version **1.0.1** (published 2015-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install elo-js
pnpm add elo-js
yarn add elo-js
bun add elo-js
```

## 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.1 |
| Published | 2015-02-23 |
| First published | 2014-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Nicolas Brugneaux |
| Maintainers | nicolasbrugneaux |
| Keywords | Elo |

## Links

- npm: https://www.npmjs.com/package/elo-js
- Repository: https://github.com/nicolasbrugneaux/elo-js
- Issues: https://github.com/nicolasbrugneaux/elo-js/issues
- npm.io page: https://npm.io/package/elo-js

## Recent versions

- 1.0.1 (latest) — 2015-02-23
- 1.0.0 — 2015-02-23
- 0.1.1 — 2014-11-23
- 0.1.0 — 2014-10-25

## README

# Elo-js [![Build Status](https://travis-ci.org/nicolasbrugneaux/elo-js.svg?branch=master)](https://travis-ci.org/nicolasbrugneaux/elo-js)

This is a small implemention of the [Elo system](http://en.wikipedia.org/wiki/Elo_rating_system). Based on wikipeda's information.

Trying to use ES6 features such as class to be fancy.

## Installation

```
npm install elo-js
```

## Usage

#### Browser

requireJS and browserify compatible.

```html
<script src="elo-js/index.js"></script>

<script>
  var elo = new Elo();

  var player1Rating = 1200;
  var player2Rating = 1250;

  var newPlayer1Rating  = elo.ifWins( player1Rating, player2Rating );
  newPlayer1Rating      = elo.ifLoses( player1Rating, player2Rating );
  newPlayer1Rating      = elo.ifTies( player1Rating, player2Rating );
</script>
```

#### Node

```js
  var Elo = require( 'elo-js' );
  var elo = new Elo();

  var player1Rating = 1200;
  var player2Rating = 1250;

  var newPlayer1Rating  = elo.ifWins( player1Rating, player2Rating );
  newPlayer1Rating      = elo.ifLoses( player1Rating, player2Rating );
  newPlayer1Rating      = elo.ifTies( player1Rating, player2Rating );
```

## Contribute

Any idea, remarks? Fill an issue, drop a mail, feel free! :heart:

## Build from source

```sh
git clone https://github.com/nicolasbrugneaux/elo-js.git
cd elo-js
npm install
gulp # watch src and runs tests
```

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