项目作者: GallagherAiden

项目描述 :
A node module for converting exercises to steps
高级语言: HTML
项目地址: git://github.com/GallagherAiden/exerciseConverter.git
创建时间: 2018-10-25T07:44:42Z
项目社区:https://github.com/GallagherAiden/exerciseConverter

开源协议:

下载


Exercise Converter


version 1.0.0
-> security updates
-> additional tests

Overview

This module allows exercises to be converted into steps. It uses public data available from the University of Vermonts website: http://www.uvm.edu/hrs/healthy/archive/steps.html

Install

Make sure your version of Node.js is at least 7.6.0.

npm install --save exerciseconverter

Exercises

  1. aerobics
  2. badminton
  3. basketball
  4. bicycling
  5. bowling
  6. boxing
  7. canoeing
  8. choppingwood
  9. circuittraining
  10. dancing
  11. elliptical
  12. firewoodtasks
  13. americanfootball
  14. gardening
  15. golfing
  16. groceryshopping
  17. handball
  18. hiking
  19. horsebackriding
  20. housework
  21. iceskating
  22. judo
  23. jumpingrope
  24. karate
  25. kickboxing
  26. mowing
  27. orienteering
  28. painting
  29. pilates
  30. pingpong
  31. racquetball
  32. rakingleaves
  33. rollerskating
  34. rowing
  35. running
  36. scubadiving
  37. skiing
  38. snowshoveling
  39. snowboarding
  40. football
  41. softball
  42. squash
  43. stairclimbing
  44. stretching
  45. swimming
  46. taekwondo
  47. tennis
  48. trampoline
  49. volleyball
  50. car
  51. wateraerobics
  52. weighttraining
  53. yardwork
  54. yoga

Intensity

Intensity is determined by effort exerted. For example, performing the exercise for leisure with light to minimal impact on breathing would be intensity 1 or 2. More competitive exercise with elevated heart rate e.g. 90 - 149 would be intensity 3 or 4. Very elevated heart rate and level of exercise unsustainable for more than ten minutes would be intensity 5.

Examples:
Hiking uphill at a fast pace might be 3 or 4. Hiking on the same incline with additional weight at the same pace would be intensity 5.

Kicking a football against a wall would be 1. Playing 11 a side would be 3 or 4. 4-a-side football for ten minutes would be a 5.

HR [Intensity]
0 - 69 [1]
70 - 89 [2]
90 - 119 [3]
120 - 149 [4]

150+ [5]

toSteps(exercise, intensity, minutes)

This async function expects an exercise, intensity and minutes to return the number of ‘steps’ taken.

Example Call

  1. toSteps("Boxing", 3, 10).then(function(steps){
  2. console.log(steps);
  3. }).catch(function(error){
  4. console.error("Error: ", error);
  5. })
  6. //output: 3480

All Input Criteria

Exercise (string): => see Exercises
Intensity (number): => 1, 2, 3, 4 or 5

Minutes (number): => any number

toStepsAvgHR(exercise, averageHeartRate, minutes)

This async function expects an exercise, average heart rate and minutes to return the number of ‘steps’ taken.

Example Call

  1. toStepsAvgHR("Boxing", 180, 1).then(function(steps){
  2. console.log(steps);
  3. }).catch(function(error){
  4. console.error("Error: ", error);
  5. })
  6. //output: 418

All Input Criteria

Exercise (string): => see Exercises
Average Heart Rate (number) [intensity]: => 0 - 69 [1], 70 - 89 [2], 90 - 119 [3], 120 - 149 [4], 150+ [5]

Minutes (number): => any number

toStepsHRpm(exercise, [HRminute1, HRminute2 …])

This async function expects an exercise, and an array of heart rate values for each minute of exercise to return the number of ‘steps’ taken.

Example Call

  1. toStepsHRpm("aerobics", [120, 140, 150, 165, 180, 176, 162, 104, 101, 80]).then(function(steps){
  2. console.log(steps);
  3. }).catch(function(error){
  4. console.error("Error: ", error);
  5. })
  6. //output: 1872

All Input Criteria

Exercise (string): => see Exercises
Heart Rate [HRminute1, HRminute2 …] (object): [120, 120, 40, 30, 60…]

Additional Information

Currently looking for feedback and requests for enhancements. Datasets, format etc. subject to change. v1.0.0 to be the first package where a normal release cycle of little change/big change etc will begin.