{"_id":"@alanko0511/open-meteo-js","_rev":"4-8496a40137eb4b1d7f2b0cbd1610ce36","name":"@alanko0511/open-meteo-js","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@alanko0511/open-meteo-js","version":"0.1.0","keywords":["open-meteo","weather","forecast","api","typescript"],"author":{"name":"Alan Ko"},"license":"MIT","_id":"@alanko0511/open-meteo-js@0.1.0","maintainers":[{"name":"alanko0511","email":"kofuklun@gmail.com"}],"homepage":"https://github.com/alanko0511/open-meteo-js#readme","bugs":{"url":"https://github.com/alanko0511/open-meteo-js/issues"},"dist":{"shasum":"789ceca067718667ac83bfc4485e7d301e880a56","tarball":"https://registry.npmjs.org/@alanko0511/open-meteo-js/-/open-meteo-js-0.1.0.tgz","fileCount":9,"integrity":"sha512-KZ/qV3ECNCZB2UCuizKALN1eoe8ukdUykgdWUESdgNvL2Dy0Ac8+fsHTBwq/SjvYkzK4imOFijxSeeiNsTH8yg==","signatures":[{"sig":"MEQCIG+nK/JiG8UO3fbWFd7ECkNWtSDixeaA+4lAXE8dalzJAiALt67ur+qczSPVhYYi91XpH8/pl0Et2EQ2dI5PpQw8bw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83123},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"fbc14f2bb9242fdf57863df44ceab1bf6c449cf8","scripts":{"test":"bun test","build":"tsdown","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"alanko0511","email":"kofuklun@gmail.com"},"repository":{"url":"git+https://github.com/alanko0511/open-meteo-js.git","type":"git"},"_npmVersion":"10.9.2","description":"A Type-safe JavaScript client for the Open-Meteo API","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ky":"^1.14.0","zod":"^4.1.12"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.16.6","@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/open-meteo-js_0.1.0_1763791242488_0.7415748481877351","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@alanko0511/open-meteo-js","version":"0.1.1","keywords":["open-meteo","weather","forecast","api","typescript"],"author":{"name":"Alan Ko"},"license":"MIT","_id":"@alanko0511/open-meteo-js@0.1.1","maintainers":[{"name":"alanko0511","email":"kofuklun@gmail.com"}],"homepage":"https://github.com/alanko0511/open-meteo-js#readme","bugs":{"url":"https://github.com/alanko0511/open-meteo-js/issues"},"dist":{"shasum":"7d3dd5d516cd30bd82dc001f7591c92ca384fbd3","tarball":"https://registry.npmjs.org/@alanko0511/open-meteo-js/-/open-meteo-js-0.1.1.tgz","fileCount":9,"integrity":"sha512-mhIj1Gemi0WUa6ufY2CEOuRTrLiP7htYxF8IMCOdagldFKgfEx4yFYmnFHaMO8//wpV74gvNQw8K2DmRAMkvgg==","signatures":[{"sig":"MEUCIQCq5I726mS7xNIhkV5vli7jdoBBMAg8C86RH2l7McC88QIgXMmSrX5ESMt3nFQSPIQLI5L5U4RN4P1fj0XLVPdzPQw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83195},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"c33bd2c3e004738c9d109daa8569b579ff62655b","scripts":{"test":"bun test","build":"tsdown","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"alanko0511","email":"kofuklun@gmail.com"},"repository":{"url":"git+https://github.com/alanko0511/open-meteo-js.git","type":"git"},"_npmVersion":"10.9.2","description":"A Type-safe JavaScript client for the Open-Meteo API","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ky":"^1.14.0","zod":"^4.1.12"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.16.6","@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/open-meteo-js_0.1.1_1763791511643_0.9500338517487672","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@alanko0511/open-meteo-js","version":"0.1.3","keywords":["open-meteo","weather","forecast","api","typescript"],"author":{"name":"Alan Ko"},"license":"MIT","_id":"@alanko0511/open-meteo-js@0.1.3","maintainers":[{"name":"alanko0511","email":"kofuklun@gmail.com"}],"homepage":"https://github.com/alanko0511/open-meteo-js#readme","bugs":{"url":"https://github.com/alanko0511/open-meteo-js/issues"},"dist":{"shasum":"c8fda10d12ec7364996d3566e89d533893a74cc4","tarball":"https://registry.npmjs.org/@alanko0511/open-meteo-js/-/open-meteo-js-0.1.3.tgz","fileCount":9,"integrity":"sha512-s06Sxw3zByNU0xje1W26zIAIpJN8Cep+TADWjhbv5T/WTHYXU+AP1qAW1PzQofCniLOfR/c5aKuDFIdeCbkIfw==","signatures":[{"sig":"MEUCIBPut7tCS3EZuOTaRR166eDdXrqQcuMnQL7j0ZUsqXzEAiEApFQfU1+YaWTZBhN8j22omZjbXfFmyo71FtTvOuRsuRg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83195},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"3e94aca8ed3e1a9468fa975618365be848aa22ec","scripts":{"test":"bun test","build":"tsdown","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"alanko0511","email":"kofuklun@gmail.com"},"repository":{"url":"git+https://github.com/alanko0511/open-meteo-js.git","type":"git"},"_npmVersion":"10.9.2","description":"A Type-safe JavaScript client for the Open-Meteo API","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ky":"^1.14.0","zod":"^4.1.12"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.16.6","@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/open-meteo-js_0.1.3_1763791956376_0.43391166709290396","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@alanko0511/open-meteo-js","version":"0.1.4","description":"A Type-safe JavaScript client for the Open-Meteo API","type":"module","license":"MIT","author":{"name":"Alan Ko"},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.mts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"scripts":{"build":"tsdown","test":"bun test","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"keywords":["open-meteo","weather","forecast","api","typescript"],"repository":{"type":"git","url":"git+https://github.com/alanko0511/open-meteo-js.git"},"dependencies":{"ky":"^1.14.0"},"devDependencies":{"@types/bun":"latest","tsdown":"^0.16.6"},"peerDependencies":{"typescript":"^5"},"gitHead":"f0d94a425bebfec8e604898f1947f43d1def2e7c","_id":"@alanko0511/open-meteo-js@0.1.4","bugs":{"url":"https://github.com/alanko0511/open-meteo-js/issues"},"homepage":"https://github.com/alanko0511/open-meteo-js#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-DivJWvD0AN7s+PWiImbMpvEC1kkjQogNyD8uvCZxT77TzNN4RTuuHEhxE8ZX87bWAg/kdlF5x9IM50PAMEV+dw==","shasum":"f6f1fb6257cb947a7ee2d9b0becb999ba12e1c2c","tarball":"https://registry.npmjs.org/@alanko0511/open-meteo-js/-/open-meteo-js-0.1.4.tgz","fileCount":9,"unpackedSize":69152,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alanko0511%2fopen-meteo-js@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEmbOHxAhujtXrf/aHV2USHdIximw7y4/VMekwLhDoFJAiArhFvPad25EcxuHR3lG/NbgpwYM2p6iqyfJWDaZmah4w=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e53b77e7-3ca5-4a51-8ac5-d31d324418ca"}},"directories":{},"maintainers":[{"name":"alanko0511","email":"kofuklun@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/open-meteo-js_0.1.4_1766197653215_0.5054669679280366"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-22T06:00:42.332Z","modified":"2025-12-20T02:27:34.469Z","0.1.0":"2025-11-22T06:00:42.741Z","0.1.1":"2025-11-22T06:05:11.845Z","0.1.3":"2025-11-22T06:12:36.580Z","0.1.4":"2025-12-20T02:27:33.367Z"},"bugs":{"url":"https://github.com/alanko0511/open-meteo-js/issues"},"author":{"name":"Alan Ko"},"license":"MIT","homepage":"https://github.com/alanko0511/open-meteo-js#readme","keywords":["open-meteo","weather","forecast","api","typescript"],"repository":{"type":"git","url":"git+https://github.com/alanko0511/open-meteo-js.git"},"description":"A Type-safe JavaScript client for the Open-Meteo API","maintainers":[{"name":"alanko0511","email":"kofuklun@gmail.com"}],"readme":"# @alanko0511/open-meteo-js\n\n[![npm](https://img.shields.io/npm/dm/@alanko0511/open-meteo-js)](https://www.npmjs.com/package/@alanko0511/open-meteo-js)\n[![npm](https://img.shields.io/npm/v/@alanko0511/open-meteo-js)](https://www.npmjs.com/package/@alanko0511/open-meteo-js)\n\nA type-safe TypeScript/JavaScript library for the [Open-Meteo Weather API](https://open-meteo.com/). This library uses the JSON API format and transforms the data into an easy-to-use structure (for me at least) with full type safety.\n\nIf you need maximum performance, you should check out their [official library](https://www.npmjs.com/package/openmeteo) which uses FlatBuffers. This library uses JSON over HTTP and focuses on developer experience and type safety.\n\n## Features\n\n- **Fully Type-Safe**: Response types automatically match your requested variables\n- **Transformed Data**: Converts Open-Meteo's parallel arrays into arrays of objects\n- **Timestamps in Milliseconds**: Unix timestamps converted to JavaScript milliseconds (ready for `new Date()`)\n- **Type-Safe Units**: Units included for all variables with full type safety\n\n## Installation\n\n```bash\n# Using Bun\nbun add @alanko0511/open-meteo-js\n\n# Using npm\nnpm install @alanko0511/open-meteo-js\n\n# Using pnpm\npnpm add @alanko0511/open-meteo-js\n\n# Using Yarn\nyarn add @alanko0511/open-meteo-js\n```\n\n## Usage\n\n### Basic Example\n\n```typescript\nimport { forecastAPI } from \"@alanko0511/open-meteo-js\";\n\nconst forecast = await forecastAPI({\n  latitude: 52.52,\n  longitude: 13.41,\n  hourly: [\"temperature_2m\", \"precipitation\", \"wind_speed_10m\"],\n  daily: [\"temperature_2m_max\", \"temperature_2m_min\"],\n  current: [\"temperature_2m\", \"weather_code\"],\n});\n\n// TypeScript knows the exact structure\nconsole.log(forecast.hourly[0].temperature_2m); // number\nconsole.log(forecast.hourly[0].precipitation); // number\nconsole.log(forecast.daily[0].temperature_2m_max); // number\nconsole.log(forecast.current.weather_code); // number\n\n// Units are also type-safe\nconsole.log(forecast.hourly_units.temperature_2m); // string (e.g., \"°C\")\nconsole.log(forecast.daily_units.temperature_2m_max); // string\n\n// These would be TypeScript errors:\n// console.log(forecast.hourly[0].cloud_cover); // Error: not requested\n// console.log(forecast.hourly_units.cloud_cover); // Error: not requested\n```\n\n### Data Format\n\nThis library transforms the data from parallel arrays to arrays of objects:\n\n**Open-Meteo Format** (parallel arrays):\n\n```typescript\n{\n  \"hourly\": {\n    \"time\": [1234567890, 1234571490, ...],\n    \"temperature_2m\": [15.2, 15.5, ...],\n    \"precipitation\": [0, 0.1, ...]\n  }\n}\n```\n\n**This Library** (array of objects):\n\n```typescript\n{\n  \"hourly\": [\n    {\n      \"time\": 1704067200000, // Unix timestamp in milliseconds\n      \"temperature_2m\": 15.2,\n      \"precipitation\": 0\n    },\n    {\n      \"time\": 1704070800000, // Unix timestamp in milliseconds\n      \"temperature_2m\": 15.5,\n      \"precipitation\": 0.1\n    }\n  ],\n  \"hourly_units\": {\n    \"temperature_2m\": \"°C\",\n    \"precipitation\": \"mm\"\n  }\n}\n```\n\n**Note:** Time values are Unix timestamps in milliseconds (JavaScript standard). You can easily convert them to Date objects:\n\n```typescript\nconst date = new Date(forecast.hourly[0].time);\n```\n\n### Advanced Options\n\n```typescript\nconst forecast = await forecastAPI({\n  latitude: 52.52,\n  longitude: 13.41,\n  hourly: [\"temperature_2m\"],\n  timezone: \"Europe/Berlin\",\n  temperature_unit: \"fahrenheit\",\n  wind_speed_unit: \"mph\",\n  precipitation_unit: \"inch\",\n  forecast_days: 7,\n  past_days: 1,\n});\n```\n\n### Commercial API & Self-Hosted Instances\n\nYou can use the commercial Open-Meteo API or self-hosted instances by providing configuration options:\n\n#### Commercial API with API Key\n\nWhen you provide an API key, the library automatically uses the commercial API endpoint (`https://customer-api.open-meteo.com/v1`):\n\n```typescript\nconst forecast = await forecastAPI(\n  {\n    latitude: 52.52,\n    longitude: 13.41,\n    hourly: [\"temperature_2m\"],\n  },\n  {\n    apiKey: \"your-api-key-here\",\n  }\n);\n```\n\n#### Self-Hosted Instance\n\nFor self-hosted Open-Meteo instances, specify a custom base URL:\n\n```typescript\nconst forecast = await forecastAPI(\n  {\n    latitude: 52.52,\n    longitude: 13.41,\n    hourly: [\"temperature_2m\"],\n  },\n  {\n    baseUrl: \"https://your-domain.com/v1\",\n  }\n);\n```\n\n#### Custom Timeout\n\nYou can also customize the request timeout (defaults to 30 seconds):\n\n```typescript\nconst forecast = await forecastAPI(\n  {\n    latitude: 52.52,\n    longitude: 13.41,\n    hourly: [\"temperature_2m\"],\n  },\n  {\n    timeout: 60000, // 60 seconds\n  }\n);\n```\n\n## Available Variables\n\n### Hourly Variables\n\n- `temperature_2m` - Temperature at 2 meters\n- `relative_humidity_2m` - Relative humidity at 2 meters\n- `dew_point_2m` - Dew point at 2 meters\n- `apparent_temperature` - Apparent temperature\n- `precipitation_probability` - Precipitation probability\n- `precipitation` - Total precipitation (rain + showers + snow)\n- `rain` - Rain\n- `showers` - Showers\n- `snowfall` - Snowfall\n- `snow_depth` - Snow depth\n- `weather_code` - WMO Weather code\n- `pressure_msl` - Sea level pressure\n- `surface_pressure` - Surface pressure\n- `cloud_cover` - Total cloud cover\n- `cloud_cover_low` - Low cloud cover\n- `cloud_cover_mid` - Mid cloud cover\n- `cloud_cover_high` - High cloud cover\n- `visibility` - Visibility\n- `evapotranspiration` - Evapotranspiration\n- `et0_fao_evapotranspiration` - Reference evapotranspiration\n- `vapour_pressure_deficit` - Vapour pressure deficit\n- `wind_speed_10m` - Wind speed at 10m\n- `wind_speed_80m` - Wind speed at 80m\n- `wind_speed_120m` - Wind speed at 120m\n- `wind_speed_180m` - Wind speed at 180m\n- `wind_direction_10m` - Wind direction at 10m\n- `wind_direction_80m` - Wind direction at 80m\n- `wind_direction_120m` - Wind direction at 120m\n- `wind_direction_180m` - Wind direction at 180m\n- `wind_gusts_10m` - Wind gusts at 10m\n- `temperature_80m` - Temperature at 80m\n- `temperature_120m` - Temperature at 120m\n- `temperature_180m` - Temperature at 180m\n- `soil_temperature_0cm` - Soil temperature at 0cm\n- `soil_temperature_6cm` - Soil temperature at 6cm\n- `soil_temperature_18cm` - Soil temperature at 18cm\n- `soil_temperature_54cm` - Soil temperature at 54cm\n- `soil_moisture_0_1cm` - Soil moisture 0-1cm\n- `soil_moisture_1_3cm` - Soil moisture 1-3cm\n- `soil_moisture_3_9cm` - Soil moisture 3-9cm\n- `soil_moisture_9_27cm` - Soil moisture 9-27cm\n- `soil_moisture_27_81cm` - Soil moisture 27-81cm\n\n### Daily Variables\n\n- `weather_code` - WMO Weather code\n- `temperature_2m_max` - Maximum temperature\n- `temperature_2m_min` - Minimum temperature\n- `apparent_temperature_max` - Maximum apparent temperature\n- `apparent_temperature_min` - Minimum apparent temperature\n- `sunrise` - Sunrise time\n- `sunset` - Sunset time\n- `daylight_duration` - Daylight duration\n- `sunshine_duration` - Sunshine duration\n- `uv_index_max` - Maximum UV index\n- `uv_index_clear_sky_max` - Maximum UV index (clear sky)\n- `rain_sum` - Rain sum\n- `showers_sum` - Showers sum\n- `snowfall_sum` - Snowfall sum\n- `precipitation_sum` - Precipitation sum\n- `precipitation_hours` - Precipitation hours\n- `precipitation_probability_max` - Maximum precipitation probability\n- `wind_speed_10m_max` - Maximum wind speed\n- `wind_gusts_10m_max` - Maximum wind gusts\n- `wind_direction_10m_dominant` - Dominant wind direction\n- `shortwave_radiation_sum` - Shortwave radiation sum\n- `et0_fao_evapotranspiration` - Reference evapotranspiration\n\n### Current Variables\n\n- `temperature_2m` - Current temperature\n- `relative_humidity_2m` - Current relative humidity\n- `apparent_temperature` - Current apparent temperature\n- `is_day` - Is it day or night\n- `precipitation` - Current precipitation\n- `rain` - Current rain\n- `showers` - Current showers\n- `snowfall` - Current snowfall\n- `weather_code` - Current weather code\n- `cloud_cover` - Current cloud cover\n- `pressure_msl` - Current sea level pressure\n- `surface_pressure` - Current surface pressure\n- `wind_speed_10m` - Current wind speed\n- `wind_direction_10m` - Current wind direction\n- `wind_gusts_10m` - Current wind gusts\n\n## Type Safety in Action\n\nThe response type adapts based on what variables you request:\n\n```typescript\n// Request only temperature\nconst response1 = await forecastAPI({\n  latitude: 52.52,\n  longitude: 13.41,\n  hourly: [\"temperature_2m\"],\n});\n// Works:\n//   response1.hourly[0].temperature_2m\n//   response1.hourly_units.temperature_2m\n// Type errors:\n//   response1.hourly[0].precipitation\n//   response1.hourly_units.precipitation\n\n// Request temperature and precipitation\nconst response2 = await forecastAPI({\n  latitude: 52.52,\n  longitude: 13.41,\n  hourly: [\"temperature_2m\", \"precipitation\"],\n});\n// Works:\n//   response2.hourly[0].temperature_2m\n//   response2.hourly[0].precipitation\n//   response2.hourly_units.temperature_2m\n//   response2.hourly_units.precipitation\n\n// Request only daily variables\nconst response3 = await forecastAPI({\n  latitude: 52.52,\n  longitude: 13.41,\n  daily: [\"temperature_2m_max\"],\n});\n// Works:\n//   response3.daily[0].temperature_2m_max\n// Type errors:\n//   response3.hourly\n//   response3.current\n```\n\n### Units\n\nUnits are automatically included for all requested variables and are also type-safe:\n\n```typescript\nconst forecast = await forecastAPI({\n  latitude: 52.52,\n  longitude: 13.41,\n  hourly: [\"temperature_2m\", \"wind_speed_10m\"],\n  temperature_unit: \"fahrenheit\",\n  wind_speed_unit: \"mph\",\n});\n\nconsole.log(forecast.hourly_units.temperature_2m); // \"°F\"\nconsole.log(forecast.hourly_units.wind_speed_10m); // \"mph\"\n// forecast.hourly_units.precipitation // Type error - not requested\n```\n\n### Working with Timestamps\n\nAll time values are returned as Unix timestamps in milliseconds (JavaScript standard):\n\n```typescript\nconst forecast = await forecastAPI({\n  latitude: 52.52,\n  longitude: 13.41,\n  hourly: [\"temperature_2m\"],\n});\n\n// Time is a number (milliseconds since Unix epoch)\nconst timestamp = forecast.hourly[0].time; // e.g., 1704067200000\n\n// Convert to Date when needed\nconst date = new Date(timestamp);\nconsole.log(date.toISOString()); // \"2024-01-01T00:00:00.000Z\"\n\n// Or use directly with Date methods\nconst hours = new Date(forecast.hourly[0].time).getHours();\n```\n\n## Error Handling\n\nThe library uses [ky](https://github.com/sindresorhus/ky) for HTTP requests, which throws `HTTPError` for non-2xx responses:\n\n```typescript\nimport { HTTPError } from \"ky\";\n\ntry {\n  const forecast = await forecastAPI({\n    latitude: 52.52,\n    longitude: 13.41,\n    hourly: [\"temperature_2m\"],\n  });\n} catch (error) {\n  if (error instanceof HTTPError) {\n    // API error (e.g., invalid coordinates, rate limiting)\n    console.error(\"API error:\", error.response.status);\n    const body = await error.response.json();\n    console.error(\"Reason:\", body.reason);\n  } else {\n    // Network or other errors\n    console.error(\"Request failed:\", error);\n  }\n}\n```\n","readmeFilename":"README.md"}