https://github.com/emanuelgsouza/bmi-utils
An library with some functions relates to Body Mass Index (BMI), like calculate and get the ideial weight
https://github.com/emanuelgsouza/bmi-utils
bmi bmi-utils body-mass javascript
Last synced: 3 months ago
JSON representation
An library with some functions relates to Body Mass Index (BMI), like calculate and get the ideial weight
- Host: GitHub
- URL: https://github.com/emanuelgsouza/bmi-utils
- Owner: emanuelgsouza
- License: mit
- Created: 2019-10-24T11:01:32.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:23:37.000Z (about 3 years ago)
- Last Synced: 2025-09-23T04:17:30.518Z (4 months ago)
- Topics: bmi, bmi-utils, body-mass, javascript
- Language: JavaScript
- Homepage: https://github.com/emanuelgsouza/bmi-utils
- Size: 1.05 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bmi-utils
A Javascript lib to calculate [body mass index](https://en.wikipedia.org/wiki/Body_mass_index).
## Install [](https://badge.fury.io/js/bmi-utils)
```sh
yarn add bmi-utils
```
## Usage
```js
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:
```js
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.
```js
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.
```js
loadCategory('M', 26.39) // returns Normal weight
```
## Author
Emanuel Gonçalves
* Twitter [@emanuelgsouza](https://twitter.com/emanuelgsouza)
* Github [@emanuelgsouza](https://github.com/emanuelgsouza)