{"id":47793502,"url":"https://github.com/adametherzlab/rain-gauge","last_synced_at":"2026-04-03T16:00:18.151Z","repository":{"id":342943221,"uuid":"1174004815","full_name":"AdametherzLab/rain-gauge","owner":"AdametherzLab","description":"Rain gauge logger — totals, rolling averages, drought detection","archived":false,"fork":false,"pushed_at":"2026-03-08T04:13:42.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-08T09:41:30.359Z","etag":null,"topics":["bun","gauge","precipitation","rain","typescript","weather"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/AdametherzLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-06T01:09:49.000Z","updated_at":"2026-03-08T04:13:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AdametherzLab/rain-gauge","commit_stats":null,"previous_names":["adametherzlab/rain-gauge"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/AdametherzLab/rain-gauge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Frain-gauge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Frain-gauge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Frain-gauge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Frain-gauge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdametherzLab","download_url":"https://codeload.github.com/AdametherzLab/rain-gauge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdametherzLab%2Frain-gauge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31362659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T15:19:21.178Z","status":"ssl_error","status_checked_at":"2026-04-03T15:19:20.670Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bun","gauge","precipitation","rain","typescript","weather"],"created_at":"2026-04-03T16:00:17.107Z","updated_at":"2026-04-03T16:00:18.142Z","avatar_url":"https://github.com/AdametherzLab.png","language":"TypeScript","readme":"[![CI](https://github.com/AdametherzLab/rain-gauge/actions/workflows/ci.yml/badge.svg)](https://github.com/AdametherzLab/rain-gauge/actions) [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)](https://www.typescriptlang.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n# rain-gauge\n\nType-safe rainfall measurement logger with drought detection, temporal analytics, and optional persistence.\n\n## Features\n\n- **Branded types** — `Millimeters` and `Days` prevent unit mix-ups at compile time\n- **Drought detection** — Configurable severity thresholds (mild/moderate/severe)\n- **Temporal analytics** — Daily, weekly, or monthly totals with rolling averages\n- **Intensity classification** — Light/moderate/heavy/violent per WMO guidelines\n- **Persistence** — Save/load data to JSON files or SQLite databases\n- **CLI included** — Log and report from the command line without writing code\n- **Zero required dependencies** — Pure TypeScript core, optional `better-sqlite3` for DB storage\n\n## Installation\n\nbash\nnpm install @adametherzlab/rain-gauge\n\n\n## Usage\n\n### Library API\n\n\nimport { RainGaugeLogger, FileStore, type Millimeters, type Days } from '@adametherzlab/rain-gauge';\n\nconst logger = new RainGaugeLogger({ \n  store: new FileStore('./rainfall.json') \n});\n\n// Record rainfall\nlogger.record({ \n  timestamp: new Date(), \n  amount: 15.5 as Millimeters \n});\n\n// Get monthly totals\nconst totals = logger.getTotals(\n  { startDate: new Date('2024-01-01'), endDate: new Date() },\n  'monthly'\n);\n\n// Check for drought\nconst drought = logger.detectDrought(\n  { startDate: new Date('2024-01-01'), endDate: new Date() },\n  7 as Days\n);\n\n\n### CLI Usage\n\nRain Gauge includes a command-line interface for quick manual entry and reports.\n\nbash\n# Log rainfall (amount in mm)\nnpx rain-gauge log 25.4 --date 2024-03-15\n\n# View daily/weekly/monthly report\nnpx rain-gauge report --period monthly\n\n# Check drought status\nnpx rain-gauge drought --threshold 5\n\n# Use SQLite storage\nnpx rain-gauge log 10.5 --store ./rain.db\n\n\n#### CLI Commands\n\n**log \u003camount\u003e** - Record rainfall amount\n  - `-d, --date \u003ciso-date\u003e` - Date of measurement (default: now)\n  - `-s, --store \u003cpath\u003e` - Data file (.json or .db)\n\n**report** - Show rainfall totals\n  - `-p, --period \u003cdaily|weekly|monthly\u003e` - Aggregation period (default: daily)\n  - `-f, --format \u003ctable|json\u003e` - Output format (default: table)\n\n**drought** - Check drought conditions\n  - `-t, --threshold \u003cdays\u003e` - Dry days threshold (default: 3)\n  - `-f, --format \u003ctable|json\u003e` - Output format\n\n**clear** - Remove all data\n  - `-s, --store \u003cpath\u003e` - Target data file\n\n#### CLI Examples\n\nbash\n# Log today's rainfall\nrain-gauge log 25.4\n\n# View monthly totals for last 30 days\nrain-gauge report --period monthly --format json\n\n# Check for drought (5+ dry days)\nrain-gauge drought --threshold 5\n\n# Clear all data\nrain-gauge clear --store ./rain.json\n\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadametherzlab%2Frain-gauge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadametherzlab%2Frain-gauge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadametherzlab%2Frain-gauge/lists"}