{"id":19889535,"url":"https://github.com/tsmx/weather-tools","last_synced_at":"2025-05-02T17:33:39.963Z","repository":{"id":57168120,"uuid":"454136486","full_name":"tsmx/weather-tools","owner":"tsmx","description":"Toolset for calculating wind chill, dew point, heat index and more.","archived":false,"fork":false,"pushed_at":"2024-06-18T20:05:46.000Z","size":397,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-19T16:35:55.447Z","etag":null,"topics":["celsius","celsius-to-fahrenheit","dew-point","fahrenheit","fahrenheit-to-celsius","heat-index","weather-station","wind-chill","wind-direction"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsmx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-31T19:11:53.000Z","updated_at":"2024-06-18T20:05:03.000Z","dependencies_parsed_at":"2023-09-24T06:32:11.923Z","dependency_job_id":"45cf2526-6e34-45db-aa30-2aba968a4f5a","html_url":"https://github.com/tsmx/weather-tools","commit_stats":{"total_commits":37,"total_committers":2,"mean_commits":18.5,"dds":0.2702702702702703,"last_synced_commit":"53d85c9413b147080eed41c78becef914e7b2de7"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmx%2Fweather-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmx%2Fweather-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmx%2Fweather-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmx%2Fweather-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsmx","download_url":"https://codeload.github.com/tsmx/weather-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224324404,"owners_count":17292521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celsius","celsius-to-fahrenheit","dew-point","fahrenheit","fahrenheit-to-celsius","heat-index","weather-station","wind-chill","wind-direction"],"created_at":"2024-11-12T18:10:39.280Z","updated_at":"2024-11-12T18:10:39.899Z","avatar_url":"https://github.com/tsmx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [**@tsmx/weather-tools**](https://github.com/tsmx/weather-tools)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n![npm (scoped)](https://img.shields.io/npm/v/@tsmx/weather-tools)\n![node-current (scoped)](https://img.shields.io/node/v/@tsmx/weather-tools)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/tsmx/weather-tools/git-build.yml?branch=master)](https://img.shields.io/github/actions/workflow/status/tsmx/weather-tools/git-build.yml?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/tsmx/weather-tools/badge.svg?branch=master)](https://coveralls.io/github/tsmx/weather-tools?branch=master)\n\n\u003e Toolset for weather data calculations and conversions.\n\nProvides the following functionalities: \n- Wind chill calculation (Celsius and Fahrenheit)\n- Dew point calculation (Celsius)\n- Heat index calculation (Celsius and Fahrenheit)\n- Degree to compass direction conversion\n- Fahrenheit \u003c\u003e Celsius conversion\n- MPH \u003c\u003e KMH conversion\n- Inch \u003c\u003e Millimeter conversion\n\n## Usage\n\nExample: calculating the dew point in Celsius from given humidity `hum` and temperature in Fahrenheit `tempF`.\n\n```js\nconst wt = require('@tsmx/weather-tools');\n\nconst tempC = wt.fahrenheitToCelsius(tempF);\nconst dewPoint = wt.dewPoint(tempC, hum);\n```\n\nFor details look the API descriptions for:\n- [Wind Chill](#wind-chill-functions)\n- [Dew Point](#dew-point-functions)\n- [Heat Index](#heat-index-functions)\n- [Unit conversions](#conversion-functions)\n\n## API\n\n### Wind chill functions\n\n#### windchillCelsius(temp, speed)\n\nCalculates the wind chill temperature in degrees Celsius.\n\n**Note:** Wind chill calculation is only feasible for low temperatures \u003c= 10 degrees Celsius and a minimum wind speed \u003e 4.8 km/h.\n\nReturns:\n- `NaN` if `temp` is greater than 10.0 degress Celsius\n- `temp` if `speed` is less than or equal to 4.8 km/h\n- the calculated wind chill otherwise\n\n##### temp\n\nType: `number`\n\nThe current temperature in degrees Celsius.\n\n##### speed\n\nType: `number`\n\nThe current wind speed in km/h.\n\n#### windchillFahrenheit(temp, speed)\n\nCalculates the wind chill temperature in degrees Fahrenheit.\n\n**Note:** Wind chill calculation is only feasible for low temperatures \u003c= 50 degrees Fahrenheit and a minimum wind speed \u003e 3.0 mph.\n\nReturns:\n- `NaN` if `temp` is greater than 50.0 degress Fahrenheit\n- `temp` if `speed` is less than or equal to 3.0 mph\n- the calculated wind chill otherwise\n\n##### temp\n\nType: `number`\n\nThe current temperature in degrees Fahrenheit.\n\n##### speed\n\nType: `number`\n\nThe current wind speed in mph.\n\n### Dew point functions\n\n#### dewPoint(temp, humidity)\n\nCalculates the dew point in degrees Celsius.\n\n##### temp\n\nType: `number`\n\nThe current temperature in degrees Celsius.\n\n##### humidity\n\nType: `number`\n\nThe current humidity in percent (0.0 - 100.0).\n\n### Heat index functions\n\n#### heatIndexCelsius(temp, humidity)\n\nCalculates the heat index in degrees Celsius.\n\n**Note:** Heat index calculation is only feasible for high temperatures \u003e= 27 degrees Celsius and a minimum humidity \u003e= 40%.\n\nReturns:\n- `NaN` if `temp` is lower than 27.0 degress Celsius or `humidity` is lower than 40.0\n- the calculated heat index otherwise\n\n##### temp\n\nType: `number`\n\nThe current temperature in degrees Celsius.\n\n##### humidity \n\nType: `number`\n\nThe current humidity in percent (0.0 - 100.0).\n\n#### heatIndexFahrenheit(temp, humidity)\n\nCalculates the heat index in degrees Fahrenheit.\n\n**Note:** Heat index calculation is only feasible for high temperatures \u003e= 80 degrees Fahrenheit and a minimum humidity \u003e= 40%.\n\nReturns:\n- `NaN` if `temp` is lower than 80.0 degress Fahrenheit or `humidity` is lower than 40.0\n- the calculated heat index otherwise\n\n##### temp\n\nType: `number`\n\nThe current temperature in degrees Fahrenheit.\n\n##### humidity \n\nType: `number`\n\nThe current humidity in percent (0.0 - 100.0).\n\n### Conversion functions\n\n#### degreesToDirection(deg)\n\nConverts degrees to the closest matching compass direction, e.g. 0 to `N`, 35 to `NE`, 301 to `WNW` and so on.\n\nA 32-point compass rose is used for the conversion.\n\n| Degree | Direction / returned value|\n|--------|---------------------------|\n| 0.0    | `N`                       |\n| 22.5   | `NNE`                     |\n| 45.0   | `NE`                      |\n| 67.5   | `ENE`                     |\n| 90.0   | `E`                       |\n| 112.5  | `ESE`                     |\n| 135.0  | `SE`                      |\n| 157.5  | `SSE`                     |\n| 180.0  | `S`                       |\n| 202.5  | `SSW`                     |\n| 225.0  | `SW`                      |\n| 247.5  | `WSW`                     |\n| 270.0  | `W`                       |\n| 292.5  | `WNW`                     |\n| 315.0  | `NW`                      |\n| 337.5  | `NNW`                     |\n\n##### deg\n\nType: `number`\n\nNumber of degrees to be converted\n\n#### fahrenheitToCelsius(fahrenheit)\n\nConverts Fahrenheit to Celsius.\n\n##### fahrenheit\n\nType: `number`\n\nThe value to be converted in degrees Fahrenheit\n\n#### celsiusToFahrenheit(celsius)\n\nConverts Celsius to Fahrenheit.\n\n##### ceslsius\n\nType: `number`\n\nThe value to be converted in degrees Celsius\n\n#### mphToKmh(mph)\n\nConverts MPH to KMH.\n\n##### mph\n\nType: `number`\n\nThe value to be converted in MPH.\n\n#### kmhToMph(kmh)\n\nConverts KMH to MPH.\n\n##### kmh\n\nType: `number`\n\nThe value to be converted in KMH.\n\n#### inchToMillimeter(inch)\n\nConverts inches to millimeters.\n\n##### inch\n\nType: `number`\n\nThe value to be converted in millimeters.\n\n#### millimeterToInch(millimeter)\n\nConverts millimeters to inches.\n\n##### millimeter\n\nType: `number`\n\nThe value to be converted in inches.\n\n## References\n\nThe implementations in this library are based on the following references.\n\n[Wind chill formulas](https://en.wikipedia.org/wiki/Wind_chill)\n\n[Dew point formulas](https://www.wetterochs.de/wetter/feuchte.html)\n\n[Heat index formulas](https://en.wikipedia.org/wiki/Heat_index)\n\n[Wind/compass direction algorithm](https://www.campbellsci.com/blog/convert-wind-directions)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsmx%2Fweather-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsmx%2Fweather-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsmx%2Fweather-tools/lists"}