Socket
Book a DemoInstallSign in
Socket

body-mass-index

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

body-mass-index

Calculate the body mass index (BMI) with the freedom of multiple units

1.0.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

body-mass-index Build Status XO code style

Calculate the body mass index (BMI) with the freedom of multiple units

bodyMassIndex('200 lb', '6ft 9in') => 21.4

Install

$ npm install --save body-mass-index

Usage

Typical Usage

const bodyMassIndex = require('body-mass-index');
bodyMassIndex('200 lb', '6ft 9in');
// => 21.4

Advance Usage

Interchangeable Imperial and Metric Units

const bodyMassIndex = require('body-mass-index');
bodyMassIndex('90.17kg 1lb 100g', '145.27cm 1ft 0.30m');
// => 21.4

API

bodyMassIndex(weight, height [,options])

Weight

Type: string || number

A combination of multiple masses (n units(mc|mg|g|kg|oz|lb)). A sole number input shall cause the function to default to kg.

Height

Type: string || number

A combination of multiple lengths (n units(mm|cm|m|km|in|yd|ft|mi)). A sole number input shall cause the function to default to m.

options

round

Type: number
Default: 1

The decimal place for the returned BMI to be rounded to.

License

MIT © Brandon Him

Keywords

health

FAQs

Package last updated on 06 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.