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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kuuki/gios-events

v2.1.1

Published

An enhanced version of @kuuki/gios with events support

Downloads

19

Readme

lerna GitHub

@kuuki/gios-events is an event based api wrapper for GIOS written in TypeScript.

GIOS stands for (CHIEF INSPECTORATE FOR ENVIRONMENTAL PROTECTION).

This library provides the following functionality:

  • [x] Load the state from the API.
  • [x] Retrieve all measurement stations from the local state.
  • [x] Retrieve all measurement station sensors from the local state.
  • [x] Retrieve latest measurements of a sensor (up to 62h back) with time series granularity of 1 hour (from the local state).
  • [ ] Retrieve air quality index for a station.

Provided events:

  • [x] stations_refreshed - Stations refreshed event.
  • [x] station_joined - New station joined event.
  • [x] station_left - Station left event.
  • [x] sensors_refreshed - Sensors refreshed event.
  • [x] sensor_joined - New sensor joined event.
  • [x] sensor_left - Sensor left event.
  • [x] data_refreshed - Measurement data refreshed event.
  • [x] data - Raw data being processed and classified.
  • [x] measurement - New and valid (not null and never registed in local state) measurement event.
  • [x] measurement_update - Measurement update event (Any measurement could change after a while. Check GIOS docs for further details).
  • [ ] error - TODO

About

This library focuses on providing a strictly typed API definition and access to EventEmitter, exposing further functionality. What's basically happening is, that the state is stored locally and updated once in a while, providing you with highly flexible events, that you can attach event listeners to. If you need something less sophisticated, check out @kuuki/gios.

Installation

@kuuki/gios requires Node.js to run on the backend.

$ npm install --save @kuuki/gios @kuuki/gios-events

Usage

(async() => {
  const eventApi = new giosEvents.GiosAirQualityEventsService(
    new gios.GiosAirQualityService(),
    {
      stations:     "*/15 * * * *", // every 15 minutes
      sensors:      "*/15 * * * *",
      measurements: "*/5 * * * *"
    }
  );
  await eventApi.initialize();
  // any measurements that have never been registered and are not null
  eventApi.on("measurement", (stationId, sensor, measurement) => {
    // find the station (to gather more metadata)
    const station = eventApi.findStation(stationId);
    console.log({
      station,
      sensor,
      measurement,
      op: "insert"
    });
  })
  eventApi.on("measurement_update", (stationId, sensor, measurement) => {
    // find the station (to gather more metadata)
    const station = eventApi.findStation(stationId);
    console.log({
      station,
      sensor,
      measurement,
      op: "upsert"
    });
  })
})();

Documentation

Generated docs are placed in the root /docs folder, you can preview them under this link, however the d.ts files should do just fine if you have your code editor and environment set up correctly.

Gios API

The official API docs can be viewed at Gios.