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

temperature-alarm-ikki646i

v1.1.0

Published

A temperature alarm

Downloads

14

Readme

IoT Devices - Assignment - Temperature

This assignment requires you to create a Node.js package that implements a basic temperature alarm.

Create a class TemperatureAlarm which periodically (every 10 seconds for example, don't hardcode it) reads a temperature from a file (later this will be refactored for the RPi).

Add an EventEmitter to the class so users can get notified if the temperature changes or reaches a given threshold.

Add a readme to the project with an example.

Make sure to create a package.json file using npm init.

Setup

Use npm install to install the required packages before using the alarm.

Usage

The temperature_alarm requires a temperature sensor object with a get_temperature() method that returns a temperature (number).

An example temperature sensor class TemperatureSensor is included for demonstration purposes. It will return the value read from a specified json file when get_temperature() is called.

To run the demonstration use the command npm start. In this example an update interval of 10 seconds and a threshold of 30 is used. You can change the value of temperature inside the temperature.json file (not while the TemperatureSensor is reading from it).

The temperature will be printed to the console when a change in temperature is detected and "alarm" with the temperature will be printed if the value reaches the threshold.

UML diagram

UML diagram