calories-burnt
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

calories-burnt

Calculate the number of calories burnt from a run.

Installation

npm i calories-burnt

Usage

import caloriesBurnt from 'calories-burnt';
 
caloriesBurnt({
    meters: 1000,
    slope: -0.015,
    treadmill: false,
    age: 23,
    restingHeartBeatsPerMinute: 80,
    kilograms: 80
}); // => 87
 

caloriesBurnt({meters, slope, treadmill?, age, restingHeartBeatsPerMinute, kilograms}) => number

Options:

  • meters: Distance run in meters, not factoring in altitude.
  • slope: The slope in percentage. -0.015 means that the run was downhill with a -1.5% slope.
  • treadmill: Whether the run was on a treadmill. Because there is no air resistance, fewer calories will be burnt. Optional. Default value: false.
  • age: The age of the runner.
  • restingHeartBeatsPerMinute: The resting heart heart beats per minute rate. Normal rate is between 60-100bpm. Athletes have a lower rate and therefore burn fewer calories.
  • kilograms: Weight of the runner in kilograms.

Contribution

Contributions welcome. Test suite can be run using npm test.

Author

Jonny Burger

License

© 2019 MIT

Credits

Package Sidebar

Install

npm i calories-burnt

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

10.9 kB

Total Files

11

Last publish

Collaborators

  • jonny