Skip to content

alaminrifat/calc-bmi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BMI Calculator Package

This npm package provides a set of functions for health-related calculations BMI (Body Mass Index) The function are designed to work with metric units, specifically weight in kilograms and height in meters.

Installation

You can install the package using npm:

npm install calc-bmi

Usage

Here's an example of how to use the BMI calculation function from the package:

import { getBMI } from 'health-utils';

const result = getBMI(70, 1.75);
console.log(result);

This will output an object containing the calculated BMI and its corresponding WHO classification:

{ bmi: '22.86', status: 'Normal' }

Functions

getBMI(weight, height)

Calculates the Body Mass Index (BMI) based on weight and height in kilograms and meters, respectively.

  • Parameters:

    • weight (number): The weight in kilograms.
    • height (number): The height in meters.
  • Throws:

    • TypeError if weight or height is not a number.
  • Returns:

    • An object containing the calculated BMI and the corresponding WHO classification.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published