nutrition-calculator
v2.0.0
Published
This package helps you calculate your Maintenance Calories and Macronutrient breakdown based on your activity level and caloric needs. The package provides an easy-to-use method for determining how many calories you need to maintain your current weight a
Readme
Nutrition Calculator
This package helps you calculate your Maintenance Calories and Macronutrient breakdown based on your activity level and caloric needs. The package provides an easy-to-use method for determining how many calories you need to maintain your current weight and how to distribute those calories across macronutrients (carbs, proteins, and fats).
Installation
npm install nutrition-calculatorUsage
Here’s how you can use the package to calculate your Maintenance Calories and the breakdown of macronutrients.
Calculate Maintenance Calories
genderoptions:male|femaleheightincmweightinkgageinyearsactivityoptions:sedentary,lightActivity,moderatelyActive,veryActive,extraActive
import { calculateMaintenanceCalories, Gender, ActivityFactor } from 'nutrition-calculator';
calculateMaintenanceCalories({ gender: 'male', height: 184, weight: 94.2, age: 32, activity: 'lightActivity' });
// -> 2841Calculate Macro Nutritions
calorieswhich the nutrition split is based on- amount of
carbohydratesin% - amount of
fatin% - amount of
proteinsin%
import { calculateMacroNutritions } from 'nutrition-calculator';
calculateMacroNutritions({ calories: 2841, percentageSplit: { carbohydrates: 50, fat: 30, protein: 20 } });
// -> { carbohydrates: 355, fat: 95, protein: 142 }Changelog
See Changelog.
License
This package is open-source and available under the MIT License.
