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

katch-mcardle-bmr

v1.0.1

Published

Function for calculating basal metabolic rate the Katch-McArdle way.

Downloads

7

Readme

katch-mcardle-bmr

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

Installation

Install the package via npm:

npm install katch-mcardle-bmr --save

or yarn:

yarn add katch-mcardle-bmr

Usage

Import:

import calculateKatchMcardleBmr from 'katch-mcardle-bmr';

The function signature itself is as follows:

calculateKatchMcArdleBmr({weight,
    bodyFatPercentage,
    useImperial = true})

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

bodyFatPercentage: Percentage of body fat, which can be expressed either in integer form (e.g. 25) or in decimal form (0.25). The function will have equivalent output for either format (see the first unit test/spec under the 'formula' fixture). The calculation will throw an error if bodyFatPercentage is not a number between 0 and 100; values between 0 and 1 are treated as a percentage in decimal form.

useImperial: When true (the default), assumes weight and height is in imperial measurement (pounds). When false, assumes weight is in metric (kg).

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.