@verifyhash/psychrometrics 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 <OWNER-NAME PLACEHOLDER>
3
+ Copyright (c) 2026 verifyhash
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,12 +1,5 @@
1
1
  # psychrometrics
2
2
 
3
- <!-- publish-prep -->
4
- > **TODO (owner): pick the final npm name/scope before publishing.**
5
- > The npm package name is **not** finalized by this project. Convention used here:
6
- > `package.json` keeps the working slug `psychrometrics` as a placeholder — replace it
7
- > (and the `npm install` line below) with the real published name/scope before
8
- > running `npm publish`.
9
-
10
3
  A tiny, **zero-dependency** Node library for humidity and moist-air math:
11
4
  saturation vapour pressure, dew point, relative and absolute humidity, the NOAA
12
5
  heat index, and Stull's wet-bulb temperature.
@@ -169,15 +162,12 @@ MIT.
169
162
 
170
163
  ## Install
171
164
 
172
- > Placeholder name: the `psychrometrics` below is the working slug, not a finalized
173
- > npm name — see the owner TODO near the top of this README.
174
-
175
165
  ```sh
176
- npm install psychrometrics
166
+ npm install @verifyhash/psychrometrics
177
167
  ```
178
168
 
179
169
  ```js
180
- const psy = require('psychrometrics');
170
+ const psy = require('@verifyhash/psychrometrics');
181
171
 
182
172
  psy.dewPoint(30, 50); // 18.45 (°C)
183
173
  psy.heatIndex(32, 70); // 40.4 (°C, "feels like")
package/index.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Type declarations for @verifyhash/psychrometrics — zero-dependency humidity
3
+ * & moist-air math (Magnus/Alduchov-Eskridge, NOAA Rothfusz, Stull 2011).
4
+ *
5
+ * Units: temperatures in °C, relative humidity in percent (0..100 — NOT a
6
+ * 0..1 fraction; out-of-range rhPct throws RangeError), pressures in hPa,
7
+ * absolute humidity in g/m³. All inputs must be finite numbers or a
8
+ * TypeError is thrown.
9
+ */
10
+
11
+ /**
12
+ * Saturation vapour pressure of water in air, hPa. Magnus formula with
13
+ * Alduchov & Eskridge (1996) coefficients; < 0.4 % error over ~ -40..+50 °C.
14
+ */
15
+ export function saturationVaporPressure(tempC: number): number;
16
+
17
+ /**
18
+ * Dew-point temperature, °C (Magnus inverse). Returns -Infinity for
19
+ * rhPct === 0 (dry air never saturates on cooling).
20
+ */
21
+ export function dewPoint(tempC: number, rhPct: number): number;
22
+
23
+ /**
24
+ * Relative humidity, percent, from air temperature and dew point. May exceed
25
+ * 100 if dewPointC > tempC.
26
+ */
27
+ export function relativeHumidity(tempC: number, dewPointC: number): number;
28
+
29
+ /** Absolute humidity: mass of water vapour per cubic metre of air, g/m³. */
30
+ export function absoluteHumidity(tempC: number, rhPct: number): number;
31
+
32
+ /**
33
+ * Heat index (apparent temperature), °C, via the NOAA/NWS Rothfusz
34
+ * regression. Meaningful mainly for T ≳ 27 °C and RH ≳ 40 %; below that it
35
+ * returns the simple Steadman value (≈ air temperature).
36
+ */
37
+ export function heatIndex(tempC: number, rhPct: number): number;
38
+
39
+ /**
40
+ * Wet-bulb temperature, °C, via Stull's (2011) empirical fit. Valid at
41
+ * standard sea-level pressure for roughly -20..+50 °C and 5..99 % RH
42
+ * (±1 °C); not corrected for altitude.
43
+ */
44
+ export function wetBulb(tempC: number, rhPct: number): number;
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@verifyhash/psychrometrics",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Zero-dependency humidity & moist-air math: saturation vapour pressure, dew point, relative & absolute humidity, NOAA heat index, and Stull wet-bulb temperature.",
5
5
  "main": "index.js",
6
+ "types": "index.d.ts",
6
7
  "type": "commonjs",
7
8
  "scripts": {
8
9
  "test": "node test/psychrometrics.test.js"
@@ -24,7 +25,8 @@
24
25
  "license": "MIT",
25
26
  "files": [
26
27
  "index.js",
27
- "README.md"
28
+ "README.md",
29
+ "index.d.ts"
28
30
  ],
29
31
  "publishConfig": {
30
32
  "access": "public"