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

exerciseconverter

v1.0.0

Published

converter for exercise into steps

Downloads

33

Readme

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

aerobics  
badminton  
basketball  
bicycling  
bowling  
boxing  
canoeing  
choppingwood  
circuittraining  
dancing  
elliptical  
firewoodtasks  
americanfootball  
gardening  
golfing  
groceryshopping  
handball  
hiking  
horsebackriding  
housework  
iceskating  
judo  
jumpingrope  
karate  
kickboxing  
mowing  
orienteering  
painting  
pilates  
pingpong  
racquetball  
rakingleaves  
rollerskating  
rowing  
running  
scubadiving  
skiing  
snowshoveling  
snowboarding  
football  
softball  
squash  
stairclimbing  
stretching  
swimming  
taekwondo  
tennis  
trampoline  
volleyball  
car  
wateraerobics  
weighttraining  
yardwork  
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

toSteps("Boxing", 3, 10).then(function(steps){
  console.log(steps);
}).catch(function(error){
  console.error("Error: ", error);
})

//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

toStepsAvgHR("Boxing", 180, 1).then(function(steps){
  console.log(steps);
}).catch(function(error){
  console.error("Error: ", error);
})

//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

toStepsHRpm("aerobics", [120, 140, 150, 165, 180, 176, 162, 104, 101, 80]).then(function(steps){
  console.log(steps);
}).catch(function(error){
  console.error("Error: ", error);
})

//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.