1.1.0 • Published 5 years ago

bmi-utils v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

bmi-utils

A Javascript lib to calculate body mass index.

Install npm version

yarn add bmi-utils

Usage

import { calculate } from 'bmi-utils'

// ... your code here

Library functions

This lib exports the following functions:

calculate(weight, heigth)

This function receives weight (Number) and heigth (Number) and return a BMI calculated. Examples:

calculate(65, 1.7) // returns '22.49'

ideialWeight(height, genre)

This function receives height (Number) and genre (String) and return a object with min and max ideal weight.

ideialWeight(1.70, 'M') // returns { min: '59.82', max: '76.27' }

loadCategory(genre, imc, translation)

This function receives genre (String), imc (Number), and translation (String - optional) properties and return a string with categorization of BMI.

loadCategory('M', 26.39) // returns Normal weight

Author

Emanuel Gonçalves

1.1.0

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago