5rate-star
v0.0.6
Published
Simple library for 5-star rating.
Downloads
32
Readme
Installation
Install with yarn or npm:
yarn
ornpm
:
# yarn
yarn add 5rate-star
# npm
npm i 5rate-star --save
Import the lib with es6 or cjs:
// es6
import { Rating, SumRating } from '5rate-star';
const rating = new Rating();
const { classificationRating } = new SumRating([4, 5]);
const result = rating.calculate(classificationRating);
console.log(result); // 4.6
// cjs
const { Rating, SumRating } = require("5rate-star")
const rating = new Rating();
const { classificationRating } = new SumRating([4, 5]);
const result = rating.calculate(classificationRating);
console.log(result); // 4.6
Usage examples:
🤝 Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
Or buy me a coffee 🙌🏾
📝 License
Copyright © 2022 Hebert F Barros. This project is MIT licensed.