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

tsme-metering

v0.1.0

Published

A useful lib and CLI to collect water meter data from your TSME group provider account

Readme

TSME-Metering

A useful lib and CLI to collect water meter data from your TSME group provider account.

⚠️ This code is still experimental: you may encounter issues

Compatibility

Providers

  • Suez (https://www.toutsurmoneau.fr/)
  • ...in progress

See Known limitations - Providers for more informations

Usage

Installation

  pnpm install tsme-metering
  # or npm, yarn, whatever :D

If you don't need the lib and just want to use the CLI, you can use npx to execute it directly:

  npx tsme-metering extract-all

See CLI Usage for more informations

Configuration (env vars)

  • TSME_EMAIL: email address used to connect your water provider account
  • TSME_PASSWORD: password used to connect your water provider account

Env vars are used in both lib code and CLI usage.

This library is using dotenv so you can store env vars into a .env file.

Library

Each provider has its own client. You need to instantiate the one corresponding to your needs. To do so, you can either use the helper map providers or directly instantiate your provider (SuezClient for example):

  import { providers } from 'tsme-metering';
  const provider = providers.get("suez");
  const client = new provider(); // default email and password from env can be overloaded in the constructor
  import { SuezClient } from 'tsme-metering';
  const client = new SuezClient(); // default email and password from env can be overloaded in the constructor

Now that you have your client, you are free to call on of its functions:

  • getMetersIds()

    Get all compatible water meters ids of your account (useful for multiple water meters)

    ← Returns: number[]

  • getMetering(meterId, from?, to?)

    Get data from a specific water meter with optionnal timespan

    → Parameters: meterId (number) - from (Date) - to (Date)

    ← Returns:

      Array<{
        date: Date; // "Europe/Paris" TZ
        index: number | null; // in m³
        volume: number; // in m³
      }>
  • isLoggedIn()

    Check if the current client is currently logged in

    ← Returns: boolean

Here is a full usage example:

  import { SuezClient } from 'tsme-metering';
  const client = new SuezClient();

  // Get all meters ids
  const metersIds = await client.getMetersIds();
  if (metersIds.length < 1) {
    throw new Error('There is no compatible water meter');
  }

  const metering = await client.getMetering(meterId, new Date('2025-06-01'));
  // ...

CLI

The CLI has two commands:

  • tsme-metering extract-all --provider <suez> --start <2025-07-05> --end <2025-07-07> --format <csv|json>

    Extract all water meters data from the 2025-07-05 to the 2025-07-06 (2 days)

  • tsme-metering extract <meter-id> --provider <suez> --start <2025-07-01> --format <csv|json>

    Extract one specific water meter data from the 2025-07-01 to the last available date (yesterday)

By default, both CLI commands are extracting the current month data if no dates are specified. Both commands outputs can be redirected to a file:

  tsme-metering extract-all --start 2025-07-05 --format csv > my_water.csv

Known limitations

Session expiration

Using the library, session may expire after a few minutes of inactivity. That is a standard management. The library is not handling session expiration and this implementation is not planned for now. Feel free to request this feature in the issue section.

Providers

That library is only limited to TSME (Tout Sur Mon Eau) providers. I started with the main provider Suez but I plan to add all its branches like Eau Olivet or Dolea in the future. Again, feel free to ask for your specific provider.

Verbosity

For now the verbosity is not adjustable, this is planned in a next release.