weather-fetch-cli
v1.0.3
Published
CLI and TypeScript library for location-based weather forecasts and URL web fetching
Maintainers
Readme
weather-fetch-cli
A TypeScript CLI and library for location-based weather forecasts and URL web fetching.
It provides:
fetch: retrieve a known URL with text, markdown, or html outputweather: resolve a place name and fetch a daily forecast in one command
Requirements
- Node.js 18 or newer
Install From npm
Run without installing:
npx weather-fetch-cli weather "대전 동구"Install globally:
npm install --global weather-fetch-cli
weather-fetch-cli weather "대전 동구"Install From Source
npm install
npm run buildCLI Usage
Get tomorrow's forecast:
weather-fetch-cli weather "대전 동구"Get a specific date in JSON:
weather-fetch-cli weather "대전 동구" --date 2026-03-09 --jsonFetch any URL directly:
weather-fetch-cli fetch "https://api.open-meteo.com/v1/forecast?latitude=36.3120&longitude=127.4554&daily=weather_code,temperature_2m_max,temperature_2m_min&timezone=Asia%2FSeoul" --format textLibrary Usage
import { fetchWeatherForecast, webfetch } from "weather-fetch-cli"
const forecast = await fetchWeatherForecast("대전 동구", { date: "tomorrow" })
console.log(forecast.weatherSummary, forecast.temperatureMax, forecast.temperatureMin)
const response = await webfetch({
url: "https://api.open-meteo.com/v1/forecast?latitude=36.3120&longitude=127.4554&daily=weather_code&timezone=Asia%2FSeoul",
format: "text",
timeoutSeconds: 30,
})
console.log(response.output)Development
npm run check
npm run test
npm run buildData Sources
- Geocoding: Nominatim (OpenStreetMap)
- Forecasts: Open-Meteo
Publish Checklist
npm run check
npm run test
npm run build
npm pack --dry-runRelease Flow
This repository uses tag-based releases.
- Update
package.jsonversion. - Push the commit to
main. - Create and push a matching tag such as
v1.0.1. - GitHub Actions will:
- validate that the tag matches
package.json - run
check,test, andbuild - attach the generated
.tgztarball to a GitHub Release - publish the package to npm
- validate that the tag matches
git tag v1.0.1
git push origin main --tagsFor npm publishing, configure npm Trusted Publishing for this GitHub repository so the Release workflow can publish without a long-lived NPM_TOKEN.
