npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

waterguru-api-js

v1.2.0

Published

Unofficial TypeScript module for retrieving WaterGuru data.

Readme

waterguru-api-js

NPM version License Coverage Status TypeScript Bundle size

TypeScript client library for accessing the WaterGuru dashboard data.


Table of Contents


Installation

npm install waterguru-api-js
# or
yarn add waterguru-api-js
# or
ban add water-guru-js

Quick Start

import { WaterGuruAPI, WaterGuruDashboard } from 'waterguru-api-js';

async function main() {
  try {
    const username = process.env.WATERGURU_USER!;
    const password = process.env.WATERGURU_PASSWORD!;

    const api = new WaterGuruAPI({ username, password });
    const dashboard: WaterGuruDashboard = await api.getDashboard();

    console.log('Status:', dashboard.status);
    console.log('Water Bodies:', dashboard.waterBodies.length);

  }
  catch (error) {
    console.error('WaterGuru API error:', error)
  }
}

main().catch(console.error);

API

new WaterGuruAPI(options)

Constructor options:

| Option | Type | Required | Description | | ---------- | -------- | -------- | ------------------------------- | | username | string | ✅ | Your WaterGuru account email | | password | string | ✅ | Your WaterGuru account password |

getDashboard(): Promise<WaterGuruDashboard>

Returns the full dashboard data object. Includes water bodies, alerts, measurements, etc.


Types

Some important types exported by this library:

export interface WaterGuruDashboard {
  rspType: string;
  code: string;
  lastModified: string;
  status: 'GREEN' | 'YELLOW' | 'RED';
  waterBodies: WaterBodyView[];
  // ... more fields
}

export interface WaterBodyView {
  viewType: string;
  status: 'GREEN' | 'YELLOW' | 'RED';
  name: string;
  waterTemp: number;
  waterTempTime: string;
  // ... more fields
}

Error Handling

If something goes wrong (login failure, network issue, response mismatch, etc.), the methods throw an Error. Always wrap calls in try/catch:

try {
  const dashboard = await api.getDashboard();
} catch (err) {
  console.error("WaterGuru API error:", err);
}

Demo

A simple demonstration is included to show how to use the waterguru-api-ts library.

  1. Install dependencies

    npm install
  2. Build the library

    npm run build
  3. Build the demo

    npm run build:demo

    Note: The following error will be displayed and can safely be ignored

    demo/server.ts:4:30 - error TS2792: Cannot find module '../../dist/index.js'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?

    4 import { WaterGuruAPI } from "../../dist/index.js";

  4. Run the demo server

    npm run demo

    The server will start on http://localhost:3000

  5. Open the demo in a browser

    Open http://localhost:3000 and enter your WaterGuru username and password. The dashboard data will be fetched and sample data displayed on the page.

Changelog

[1.2.0] - 2025-10-10

Changed

  • Updated types.ts

[1.1.1] - 2025-10-08

Fixed

  • Added demo script to package.json

Changed

  • Updated README.md

[1.1.0] - 2025-09-21

Added

  • Added demo page and server
  • Updated build system to handle both distribution and demo

[1.0.0] - 2025-09-20

Added

  • Initial release of waterguru-api-ts.

Caveats & Limitations

  • This is an unofficial library.
  • WaterGuru does not publish a stable public API; endpoints may change without warning.
  • Avoid frequent polling — excessive requests may result in blocks or rate limiting.

License

MIT © Steve Maze


Credits

  • This library is inspired by and ported from bdwilson/waterguru-api.
    Huge thanks to bdwilson and contributors for their work.