Skip to content

Commit

Permalink
Merge pull request #2 from msn0/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
msn0 authored Jul 15, 2017
2 parents aec6cbf + f1f0356 commit 37e522a
Show file tree
Hide file tree
Showing 15 changed files with 3,791 additions and 224 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 120
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
extends: ['helmut']
}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
.idea
coverage
node_modules
test-results.xml
15 changes: 0 additions & 15 deletions .jshintrc

This file was deleted.

5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
sudo: false
language: node_js
node_js:
- 0.10
before_install: npm install -g grunt-cli
install: npm install
- '8'
46 changes: 0 additions & 46 deletions Gruntfile.js

This file was deleted.

23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
# Wilson Score Interval [![Build Status](https://secure.travis-ci.org/msn0/wilson-score-interval.png?branch=master)](http://travis-ci.org/msn0/wilson-score-interval)

Simple implementation of [Wilson score interval](http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval) for browser. A Node.js version can be found here https://github.com/msn0/wilson-node.
Simple implementation of [Wilson score interval](http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval).

Wilson score interval is a perfect tool for scoring comments. The only data you need is a number of upvotes and a total number of votes. It has really good properties even for small number of votes.

## Installation

```
npm install wilson-score-interval
```
or

```
bower install wilson-score-interval
```sh
$ npm i wilson-score-interval
```

## Usage

```js
wilson(upVotes, total);
const wilson = require('wilson-score-interval');

/*
wilson(upVotes, total);
*/

wilson(430, 474); // {left: 0.8776750858242243, right: 0.9301239839930541}
wilson(392, 436); // {left: 0.8672311846637769, right: 0.9239627360567735}
wilson(10, 14); // {left: 0.4535045882751561, right: 0.882788120898909}
wilson(430, 474); // { left: 0.8776750858242243, right: 0.9301239839930541 }
wilson(392, 436); // { left: 0.8672311846637769, right: 0.9239627360567735 }
wilson(10, 14); // { left: 0.4535045882751561, right: 0.882788120898909 }
```
24 changes: 0 additions & 24 deletions bower.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/wilson.js

This file was deleted.

43 changes: 0 additions & 43 deletions karma.conf.js

This file was deleted.

Loading

0 comments on commit 37e522a

Please sign in to comment.