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

infant-nutrition-calculator

v1.0.3

Published

Calculator of infants nutrition based on WHO standards.

Downloads

8

Readme

infant-nutrition-calculator

Calculator of infants nutrition based on WHO standards.

Installation

npm install infant-nutrition-calculator --save

Basic Usage

let nutritionCalculator = new (require('infant-nutrition-calculator'))('LANGUAGE')

OR

let infantNutritionCalculator = require('infant-nutrition-calculator')
let nutritionCalculator = new infantNutritionCalculator('LANGUAGE')

LANGUAGE is a variable passed to the contructor that can take 3 different values: 'EN' (English), 'FR' (French) or 'ES' (Spanish). Results would be returned in the language selected. Default language is English

Basic Usage

nutritionCalculator.calculateNutrition(months, gender, weight, height)

Where:

  • months: A int from 24 to 60. (From 2 years old until 5 years old)
  • gender: Either "M" (Male) or "F" (Female)
  • weight: The weight of the infant. A number variable that can take any number of decimals.
  • height: The height of th infant. A number variable that can take any number of decimals.

Example response

{
  months: 36,
  gender: 'M',
  weight: 14.5,
  height: 96,
  WFA: {
    ID: 'M36',
    Sexo: 'M',
    Meses: '36',
    L: '-0.0689',
    M: '14.3429',
    S: '0.12116',
    zWFA: 0.08987715419006534,
    risk: 'Correcta'
  },
  HFA: {
    ID: 'M36',
    Sexo: 'M',
    Meses: '36',
    L: '1',
    M: '96.0835',
    S: '0.03858',
    zHFA: -0.02252555175172329,
    risk: 'Correcta'
  },
  WFH: {
    ID: 'M96',
    Sexo: 'M',
    'Talla(cm)': '96.0',
    L: '-0.3521',
    M: '14.3037',
    S: '0.08083',
    zWFH: 0.16822650832354302,
    risk: 'Correcta'
  },
  recommendedAction: 'Infant is healthy. No further action needed.'
}

Additional calculations

You can call each of the internal functions separately, in case you are only interested in one of the indicators:

nutritionCalculator.calculateWFA(months, gender, weight)
nutritionCalculator.calculateHFA(months, gender, height)
nutritionCalculator.calculateWFH(gender, weight, height)

Formulas

Formula

  • Source: World Health Organization https://www.who.int/childgrowth/standards/Technical_report.pdf?ua=1

  • Z tables: https://www.who.int/childgrowth/standards/lhfa_girls_2_5_zscores.txt https://www.who.int/childgrowth/standards/lhfa_boys_2_5_zscores.txt https://www.who.int/childgrowth/standards/chts_wfa_girls_z/en/ https://www.who.int/childgrowth/standards/chts_wfa_boys_z/en/ https://www.who.int/childgrowth/standards/w_f_l_tables_z_girls/en/ https://www.who.int/childgrowth/standards/w_f_l_tables_z_boys/en/

Links

  • WHO. World Health Organization https://www.who.int/childgrowth/en/ https://www.who.int/childgrowth/standards/Technical_report.pdf?ua=1 https://www.who.int/childgrowth/standards/velocity/tr3_velocity_report.pdf?ua=1

  • Spanish Asociation of Pediatricians: https://www.aeped.es/sites/default/files/documentos/valoracion_nutricional.pdf