
Security Fundamentals
Obfuscation 101: Unmasking the Tricks Behind Malicious Code
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
@tsmx/weather-tools
Advanced tools
Toolset for calculating wind chill, dew point, heat index and more.
Toolset for weather data calculations and conversions.
Provides the following functionalities:
Example: calculating the dew point in Celsius from given humidity hum
and temperature in Fahrenheit tempF
.
const wt = require('@tsmx/weather-tools');
const tempC = wt.fahrenheitToCelsius(tempF);
const dewPoint = wt.dewPoint(tempC, hum);
For details look the API descriptions for:
Calculates the wind chill temperature in degrees Celsius.
Note: Wind chill calculation is only feasible for low temperatures <= 10 degrees Celsius and a minimum wind speed > 4.8 km/h.
Returns:
NaN
if temp
is greater than 10.0 degress Celsiustemp
if speed
is less than or equal to 4.8 km/hType: number
The current temperature in degrees Celsius.
Type: number
The current wind speed in km/h.
Calculates the wind chill temperature in degrees Fahrenheit.
Note: Wind chill calculation is only feasible for low temperatures <= 50 degrees Fahrenheit and a minimum wind speed > 3.0 mph.
Returns:
NaN
if temp
is greater than 50.0 degress Fahrenheittemp
if speed
is less than or equal to 3.0 mphType: number
The current temperature in degrees Fahrenheit.
Type: number
The current wind speed in mph.
Calculates the dew point in degrees Celsius.
Type: number
The current temperature in degrees Celsius.
Type: number
The current humidity in percent (0.0 - 100.0).
Calculates the heat index in degrees Celsius.
Note: Heat index calculation is only feasible for high temperatures >= 27 degrees Celsius and a minimum humidity >= 40%.
Returns:
NaN
if temp
is lower than 27.0 degress Celsius or humidity
is lower than 40.0Type: number
The current temperature in degrees Celsius.
Type: number
The current humidity in percent (0.0 - 100.0).
Calculates the heat index in degrees Fahrenheit.
Note: Heat index calculation is only feasible for high temperatures >= 80 degrees Fahrenheit and a minimum humidity >= 40%.
Returns:
NaN
if temp
is lower than 80.0 degress Fahrenheit or humidity
is lower than 40.0Type: number
The current temperature in degrees Fahrenheit.
Type: number
The current humidity in percent (0.0 - 100.0).
Converts degrees to the closest matching compass direction, e.g. 0 to N
, 35 to NE
, 301 to WNW
and so on.
A 32-point compass rose is used for the conversion.
Degree | Direction / returned value |
---|---|
0.0 | N |
22.5 | NNE |
45.0 | NE |
67.5 | ENE |
90.0 | E |
112.5 | ESE |
135.0 | SE |
157.5 | SSE |
180.0 | S |
202.5 | SSW |
225.0 | SW |
247.5 | WSW |
270.0 | W |
292.5 | WNW |
315.0 | NW |
337.5 | NNW |
Type: number
Number of degrees to be converted
Converts Fahrenheit to Celsius.
Type: number
The value to be converted in degrees Fahrenheit
Converts Celsius to Fahrenheit.
Type: number
The value to be converted in degrees Celsius
Converts MPH to KMH.
Type: number
The value to be converted in MPH.
Converts KMH to MPH.
Type: number
The value to be converted in KMH.
Converts inches to millimeters.
Type: number
The value to be converted in millimeters.
Converts millimeters to inches.
Type: number
The value to be converted in inches.
The implementations in this library are based on the following references.
FAQs
Toolset for calculating wind chill, dew point, heat index and more.
We found that @tsmx/weather-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.