npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

harris-benedict-bmr

v1.0.1

Published

Function for calculating basal metabolic rate the Harris-Benedict way.

Downloads

8

Readme

harris-benedict-bmr

Function for calculating basal metabolic rate the Harris-Benedict way.
A companion package that calculates BMR using the Katch-McArdle method can be found at
katch-mcardle-bmr.

Installation

Install the package via npm:

npm install harris-benedict-bmr --save

or yarn:

yarn add harris-benedict-bmr

Usage

Import:

import calculateHarrisBenedictBmr from 'harris-benedict-bmr';

The function signature itself is as follows:

calculateHarrisBenedictBmr({weight,
    height,
    age,
    isMale = true,
    useImperial = true,
    useMifflinJeor = true})

weight: Weight in pounds or kilograms (see useImperial below). The calculation will throw an error if weight is not a number above 0.

height: Height in inches or cm (see useImperial below). The calculation will throw an error if height is not a number above 0.

age: Age in years. The calculation will throw an error if age is not a number above 0.

isMale: Distinguishes between male and female coefficents for the calculation.

useImperial: When true (the default), assumes weight and height are in imperial measurements (pounds and inches, respectively). When false, assumes weight and height are in metric measurements (kg and cm, respectively).

useMifflinJeor: There have been 2 revisions to the original 1918 formula to make it more accurate. The first revision was by Roza and Shizgai in 1984, and the second was by Mifflin and St Jeor in 1990. This calculation defaults to using the Mifflin-Joer revision as it is the most accurate. If for some reason the user would prefer to use the Roza/Shizgai revision setting this value to false will change the calculation. The original 1918 version is not present in this library. If someone from the previous century feels keenly enough about its inclusion, they are welcome to submit a patch to add its presence. =)

License

This package is under an ISC license.

Contributing

This package has a suite of unit tests written in Jest. Alterations or additions are expected to have unit tests present in the PR.

Prettier is used for code formatting and can be run using npm run pretty - please use it on any changes that would be made.