Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

average-rating

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

average-rating - npm Package Compare versions

Comparing version 0.0.11 to 0.1.2

.travis.yml

7

package.json
{
"version": "0.0.11",
"version": "0.1.2",
"name": "average-rating",

@@ -18,6 +18,7 @@ "description": "Calculate average score and rating based on Wilson Score Equation",

},
"dependencies": {
"bellajs": "latest"
"scripts": {
"test": "mocha test"
},
"devDependencies": {
"bellajs": "latest",
"mocha": "latest",

@@ -24,0 +25,0 @@ "chai": "latest"

# average-rating
Calculate average and scoring based on Wilson Score Equation
![Travis](https://travis-ci.org/ndaidong/average-rating.svg?branch=master)
![Google app on Google Play](http://i.imgur.com/NgQX5OW.png)
## Usage

@@ -10,5 +14,15 @@

// from 1 to 5 stars
let rating = [9524, 4158, 10177, 25971, 68669];
let score = Calculator.score(rating); // --> 0.79
let average = Calculator.average(rating); // --> 4.2
let rating = [134055, 57472, 143135, 365957, 1448459];
let score = Calculator.score(rating); // --> 0.84
let average = Calculator.average(rating); // --> 4.4
```
## Test
```
npm install
mocha
```
_* Ensure that you have [mocha](https://mochajs.org/) installed_
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc