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

wot-emulator

v0.1.0

Published

The **Web of Things (WoT) Simulator** is a simulator that allows you to emulate connected devices in the context of the Internet of Things (IoT) using the Web of Things model. The project enables you to insert different types of **Thing** into a specific

Downloads

4

Readme

Web of Things Simulator

Project Description

The Web of Things (WoT) Simulator is a simulator that allows you to emulate connected devices in the context of the Internet of Things (IoT) using the Web of Things model. The project enables you to insert different types of Thing into a specific environment and monitor and interact with their properties and actions.

Currently, the program includes two example SituatedThing types: LampThing and Radiator, along with a HeatingEnv as the environment.

Example Things:

  • LampThing
    A lamp that can be turned on or off using the 'toggle' function. When on, the intensity of the light increases periodically.

  • Radiator
    A radiator that can be turned on or off using the 'toggle' function. When on, it increases the temperature of the environment it is placed in.

  • HeatingEnv
    An environment that can be heated using the increaseTemperature(energy) function.

In the project, the configuration file ./src/td/config.json contains an example of a HeatingEnv with 2 LampThing (with different periods) and 2 Radiator (with different powers).


How to Use

1. Configure the Paths

Before running the simulation, you need to configure the paths to the configuration file, SituatedThing models, and Environment models:

  • CONFIG: Path to the configuration file (config.json).
  • THING_MODEL: Path to the folder containing SituatedThing models.
  • ENV_MODEL: Path to the folder containing Environment models.

Modify the variables to reflect the correct paths in your environment.

2. Add New SituatedThing or Environment

You can add new SituatedThing or new Environment.

3. Configure the config.json File

The config.json configuration file has 3 main sections:

  • "servients": Contains the configuration for the servients required for the simulation. Each servient must include the following keys:
    • 'id': Unique identifier of the servient.
    • 'type': The protocol type used by the servient (e.g., http, mqtt).
  • "environment": Configures the environment. The section should include:
    • 'servients: idServient': Specifies the servient that exposes the environment.
    • 'type', 'id', and 'title': Other details related to the environment.
  • "things": Contains an array of configurations for the Things you want to include in the environment. Each Thing must have:
    • 'servients: idServient': Specifies the servient that exposes this Thing.
    • 'type', 'id', and 'title': Details of the Thing.

Modify the configuration file as needed to customize the simulation.

4. Run the Simulation

To run the simulation, start the program from the main file (main.ts) using the following command:

npx ts-node src/main.ts

Interacting with the Simulation

A. Making GET Requests

GET requests allow you to retrieve the values of properties from Things and Environment. Example requests:

  1. Get the temperature of the environment:
    GET 'localhost:8081/heatingenv/properties/temperature'
  2. Get the power of the first radiator:
    GET 'localhost:8081/radiator1/properties/power'
  3. Get the intensity of the first lamp:
    GET 'localhost:8081/smartlamp1/properties/intensitye'

B. Making POST Requests

POST requests allow you to interact with the Things, such as turning them on or off.

  1. Turn the first lamp on or off:
    POST 'localhost:8081/smartlamp1/actions/toggle'
  2. Turn the first radiator on or off:
    POST 'localhost:8081/radiator1/actions/toggle