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

wbgt-calculator

v0.1.0

Published

WBGT (NTP 1189 / UNE-EN ISO 7243:2017): WBGT, WBGTeff, WBGTref y utilidades.

Readme

wbgt-calculator

  • Español: ver abajo “ES”.
  • English: see below “EN”.

ES

Paquete npm para calcular el índice WBGT (Wet Bulb Globe Temperature) y utilidades asociadas, siguiendo la metodología descrita en la NTP 1189 (INSST, 2023) basada en la UNE-EN ISO 7243:2017.

Incluye:

  • WBGT (interior/sin carga solar y exterior con carga solar)
  • CAV (ajuste por vestimenta) y WBGTeff
  • WBGTref (aclimatado / no aclimatado) en función de (M) (W)
  • Promedios ponderados en el tiempo (con restricción (\le 60) min, como indica la NTP)

Instalación

npm i wbgt-calculator

Uso rápido

import {
  clothingAdjustmentCavC,
  isHeatStressRisk,
  wbgtC,
  wbgtEffC,
  wbgtRefC,
} from "wbgt-calculator";

// Interior (o exterior sin carga solar): WBGT = 0.7*thn + 0.3*tg
const wbgt = wbgtC({
  environment: "indoors_or_no_solar_load",
  thnC: 23,
  tgC: 40,
});

// Ajuste por vestimenta (CAV, °C-WBGT)
const cav = clothingAdjustmentCavC("coverall_tyvek_polyolefin_single_layer", { hood: true }); // 2 + 1
const wbgtEff = wbgtEffC(wbgt, cav);

// Límite de referencia en función de metabolismo y aclimatación
const wbgtRef = wbgtRefC(180, "acclimatized");

const riesgo = isHeatStressRisk(wbgtEff, wbgtRef);
console.log({ wbgt, wbgtEff, wbgtRef, riesgo });

Exterior con carga solar

import { wbgtC } from "wbgt-calculator";

// Exterior con carga solar: WBGT = 0.7*thn + 0.2*tg + 0.1*ta
const wbgt = wbgtC({
  environment: "outdoors_with_solar_load",
  thnC: 24,
  tgC: 45,
  taC: 32,
});

Diferentes periodos (promedio ponderado)

Si en una “hora representativa” hay periodos con diferentes condiciones o actividad, puedes promediar WBGT y (M) en el tiempo.

import { timeWeightedAverage } from "wbgt-calculator";

const avg = timeWeightedAverage([
  { durationMinutes: 20, wbgtC: 28, metabolicRateW: 180 },
  { durationMinutes: 40, wbgtC: 30, metabolicRateW: 300 },
]);

console.log(avg.wbgtC, avg.metabolicRateW, avg.totalMinutes);

API

  • wbgtC({ thnC, tgC, taC?, environment }): devuelve WBGT en °C.
  • clothingAdjustmentCavC(preset, { hood? }): devuelve CAV en °C-WBGT según Tabla de la NTP.
  • wbgtEffC(wbgt, cav): devuelve WBGTeff en °C.
  • wbgtRefC(M, acclimatization): devuelve WBGTref en °C (M en W, válido 115..520).
  • timeWeightedAverage(periods): promedio ponderado (minutos) de WBGT y M (exige total ≤ 60).
  • isHeatStressRisk(wbgtEff, wbgtRef): true si WBGTeff > WBGTref.

Referencias

  • INSST (2023), NTP 1189: Evaluación del riesgo de estrés térmico: Índice WBGT.
  • UNE-EN ISO 7243:2017, Ergonomía del ambiente térmico. Evaluación del estrés al calor utilizando el índice WBGT.

EN

npm package to compute the WBGT index (Wet Bulb Globe Temperature) and related utilities, following the methodology described in NTP 1189 (INSST, 2023) based on UNE-EN ISO 7243:2017.

Includes:

  • WBGT (indoors/no solar load and outdoors with solar load)
  • CAV (clothing adjustment) and WBGTeff
  • WBGTref (acclimatized / not acclimatized) as a function of (M) (W)
  • Time-weighted averages (with a (\le 60) min constraint, as stated in the NTP)

Installation

npm i wbgt-calculator

Quick start

import {
  clothingAdjustmentCavC,
  isHeatStressRisk,
  wbgtC,
  wbgtEffC,
  wbgtRefC,
} from "wbgt-calculator";

// Indoors (or outdoors without solar load): WBGT = 0.7*thn + 0.3*tg
const wbgt = wbgtC({
  environment: "indoors_or_no_solar_load",
  thnC: 23,
  tgC: 40,
});

// Clothing adjustment (CAV, °C-WBGT)
const cav = clothingAdjustmentCavC("coverall_tyvek_polyolefin_single_layer", { hood: true }); // 2 + 1
const wbgtEff = wbgtEffC(wbgt, cav);

// Reference limit based on metabolic rate and acclimatization
const wbgtRef = wbgtRefC(180, "acclimatized");

const risk = isHeatStressRisk(wbgtEff, wbgtRef);
console.log({ wbgt, wbgtEff, wbgtRef, risk });

Outdoors with solar load

import { wbgtC } from "wbgt-calculator";

// Outdoors with solar load: WBGT = 0.7*thn + 0.2*tg + 0.1*ta
const wbgt = wbgtC({
  environment: "outdoors_with_solar_load",
  thnC: 24,
  tgC: 45,
  taC: 32,
});

Multiple periods (time-weighted average)

If your “representative hour” includes periods with different conditions or activity, you can time-weight WBGT and (M).

import { timeWeightedAverage } from "wbgt-calculator";

const avg = timeWeightedAverage([
  { durationMinutes: 20, wbgtC: 28, metabolicRateW: 180 },
  { durationMinutes: 40, wbgtC: 30, metabolicRateW: 300 },
]);

console.log(avg.wbgtC, avg.metabolicRateW, avg.totalMinutes);

API

  • wbgtC({ thnC, tgC, taC?, environment }): returns WBGT in °C.
  • clothingAdjustmentCavC(preset, { hood? }): returns CAV in °C-WBGT (per the NTP table).
  • wbgtEffC(wbgt, cav): returns WBGTeff in °C.
  • wbgtRefC(M, acclimatization): returns WBGTref in °C (M in W, valid 115..520).
  • timeWeightedAverage(periods): time-weighted average (minutes) of WBGT and M (requires total ≤ 60).
  • isHeatStressRisk(wbgtEff, wbgtRef): true if WBGTeff > WBGTref.

References

  • INSST (2023), NTP 1189: Estimation of heat stress: WBGT index.
  • UNE-EN ISO 7243:2017, Ergonomics of the thermal environment — Assessment of heat stress using the WBGT index.