@toolsnap/bmi-calculator
v1.0.0
Published
A lightweight BMI calculator utility with zero dependencies. Supports both metric and imperial units.
Downloads
64
Maintainers
Readme
@toolsnap/bmi-calculator
A lightweight, zero-dependency BMI (Body Mass Index) calculator for Node.js and browsers.
Installation
npm install @toolsnap/bmi-calculatorUsage
const { bmi, bmiImperial } = require('@toolsnap/bmi-calculator');
// Metric (kg, cm)
const result = bmi(70, 175);
// { bmi: 22.9, category: 'Normal' }
// Imperial (lbs, inches)
const result2 = bmiImperial(154, 69);
// { bmi: 22.7, category: 'Normal' }Online Tool
Prefer a GUI? Try the free online BMI Calculator — no signup, instant results.
API
| Function | Parameters | Returns |
|---|---|---|
| bmi(weight, height) | weight (kg), height (cm) | { bmi, category } |
| bmiImperial(weight, height) | weight (lbs), height (in) | { bmi, category } |
| categorize(bmi) | bmi number | category string |
License
MIT
