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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@who-growth/core

v0.4.0

Published

WHO Child Growth Standards calculator — z-scores, percentiles, and nutritional classification

Readme

@who-growth/core

WHO Child Growth Standards calculator — z-scores, percentiles, and nutritional classification.

Zero dependencies. Works in Node.js, browsers, and edge runtimes.

Features

  • 2 chart sets: WHO standard, Down syndrome (Zemel 2015)
  • 6 growth indicators: weight-for-age, length/height-for-age, BMI-for-age, head circumference-for-age, weight-for-length, weight-for-height
  • Full age range: 0–19 years (WHO), 0–18 years (Down syndrome)
  • Prematurity correction: gestational age adjustment up to 2 years
  • Nutritional classification: SISVAN/WHO cutpoints
  • i18n: pt-BR, en, es
  • LMS data: 26 official tables embedded, lazy-loaded

Chart Sets

| Chart Set | Status | Age Range | Indicators | |-----------|--------|-----------|------------| | WHO Standard | ✅ Complete | 0–19 years | All 6 | | Down Syndrome (Zemel 2015) | ✅ Complete | 0–20 years | WFA (0–18y), LFA (0–18y), BFA (0–18y), HCFA (0–20y) |

Install

npm install @who-growth/core

Usage

import { calculateZScore, calculateAll } from '@who-growth/core';

// Single indicator (WHO standard)
const result = await calculateZScore({
  indicator: 'weight-for-age',
  sex: 'male',
  ageInDays: 365,
  measurement: 9.5,
});
// → { indicator: 'weight-for-age', zScore: -0.11, percentile: 45.6 }

// Full assessment (WHO standard)
const assessment = await calculateAll({
  sex: 'female',
  dateOfBirth: new Date('2024-06-15'),
  dateOfMeasurement: new Date('2025-06-15'),
  weight: 9.2,
  lengthHeight: 74.5,
  headCircumference: 45,
  gestationalAgeWeeks: 34, // optional — triggers prematurity correction
});
// → { age, results, classifications }

// Down syndrome charts
const dsResult = await calculateAll({
  sex: 'male',
  dateOfBirth: new Date('2024-01-01'),
  dateOfMeasurement: new Date('2025-01-01'),
  weight: 8.5,
  lengthHeight: 70,
  chartSet: 'down-syndrome',
});

API

calculateZScore(input): Promise<ZScoreResult | null>

Calculate z-score and percentile for a single indicator.

Options:

  • chartSet: 'who-standard' (default) | 'down-syndrome'

calculateAll(input): Promise<AssessmentResult>

Calculate all applicable indicators for a patient, including age calculation, prematurity correction, and nutritional classification.

computeZScore(measurement, lms): number

Low-level z-score calculation from measurement and LMS parameters. Implements the WHO standard formula with L=0 handling and |Z|>3 extrapolation.

classify(result, ageInDays): Classification

Classify a z-score result using SISVAN/WHO cutpoints.

ageInDays(dateOfBirth, dateOfMeasurement): number

Calculate age in days between two dates.

correctedAgeInDays(chronologicalDays, gestationalAgeWeeks?): number

Apply prematurity correction (up to 2 years of age).

Formulas

  • Standard: Z = ((measurement/M)^L - 1) / (L × S)
  • When L=0: Z = ln(measurement/M) / S
  • |Z| > 3: WHO linear extrapolation method
  • Percentile: Normal CDF (Abramowitz & Stegun approximation)

Data Sources

  • WHO: WHO Anthro (0–5y) + WHO AnthroPlus (5–19y)
  • Down Syndrome: Zemel BS, et al. Growth Charts for Children With Down Syndrome in the United States. Pediatrics. 2015;136(5):e1204-e1211.

License

MIT