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

jsgrowup

v0.8.0

Published

Calculate z-scores of anthropometric measurements based on WHO and CDC child growth standards; translation of pygrowup

Downloads

2

Readme

jsgrowup

Build Status

jsgrowup by Global Strategies is based on pygrowup by Evan Wheeler: https://github.com/ewheeler/pygrowup

jsgrowup calculates z-scores for the following anthropometric indicators:

  • weight-for-age

  • length/height-for-age

  • weight-for-length/height

  • head-circumference-for-age

  • body-mass-index-for-age

based on the WHO Child Growth Standards:

  • http://www.who.int/childgrowth/standards/en/
  • http://www.who.int/entity/childgrowth/standards/technical_report/en/index.html

and can optionally use CDC growth standards:

  • http://www.cdc.gov/growthcharts

jsgrowup avoids floating-point operations to eliminate the unwanted rounding that muddles the precision of some of the igrowup implementations:

  • http://docs.sun.com/source/806-3568/ncg_goldberg.html

INSTALLATION

npm install jsgrowup

EXAMPLE USAGE

demo.js includes a sample z-score lookup.

EXCEPTIONS

caller should watch for:

  • AssertionError raised when caller provides inappropriate parameters

as well as more specific errors (all subclasses of RuntimeError):

  • InvalidMeasurement raised when measurement is invalid for requested indicator

  • InvalidAge raised when age is invalid for requested indicator

  • DataNotFound raised when WHO/CDC data is not found for the requested observation (e.g., box-cox, median, coefficient of variance for age)

  • DataError raised when an error occurs while loading WHO/CDC data into memory

TESTING

  • test script using mocha: mocha --delay

  • no-framework tests: node simpletests.js

The included tests use example anthropometric data taken from demonstration data shipped with WHO's igrowup software. jsgrowup performs the same calculations and compares the results to the WHO results. Please see the sofware licence agreement for WHO's igrowup, which is the source of the test data files: http://www.who.int/childgrowth/software/license2.pdf

Currently, a small number of cases fail to produce results within 1 standard deviation of the WHO resuts. These discrepancies may be due to WHO's use of floating point arithmetic in their igrowup software, which leads to less precise calculations compared to jsgrowup. In the absence of any other trusted test data, please be aware that no claims are made to the accuracy or reliability of jsgrowup's calculations.

DEVELOPING

The source WHO .txt tables can be easily converted to json with the help of two amazing python utilities:

  • The Pyed Piper https://code.google.com/p/pyp/

  • csvkit http://pypi.python.org/pypi/csvkit

heres an example one-liner that changes the source .txt from tsv to csv (with pyp) and then to json (with csvkit's csvjson) $ cat bmi_girls_2_5_zscores.txt | pyp "p.replace('\t', ',')" | csvjson > bmifa_girls_2_5_zscores.json