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

hwsim

v1.5.26

Published

This guide provides step-by-step instructions to deploy the **Hardware Simulator** application on a Debian server. Now available as an npm package, you can easily install and run the simulator using Node.js.

Readme

Hardware Simulator Deployment Guide

This guide provides step-by-step instructions to deploy the Hardware Simulator application on a Debian server. Now available as an npm package, you can easily install and run the simulator using Node.js.

Table of Contents

  1. Prepare the Debian Server
  2. Install the Hardware Simulator Package
  3. Add Systemd Service for Automatic Start
  4. Configure Firewall
  5. Configure Reverse Proxy (Optional)
  6. Monitor Logs
  7. Configuration of the Simulator

1. Prepare the Debian Server

Everything as root.

Install npm:

apt update
apt install npm -y

Verify Installation:

npm -v

2. Install the Hardware Simulator Package

Install the npm Package:

npm install -g hwsim

This will download the latest version of Hardware Simulator.

Test Locally:

Run the Hardware Simulator using the built-in npm script:

npm run start-hwsim

Ensure everything works as expected before proceeding.

Now you can run:

start-hwsim

3. Add Systemd Service for Automatic Start

Create a Systemd Service File:

nano /etc/systemd/system/hwsim.service

Add the Following Configuration:

[Unit]
Description=Hardware Simulator Application
After=network.target

[Service]
ExecStart=/usr/bin/node /usr/local/lib/node_modules/hwsim/index.js
WorkingDirectory=/usr/local/lib/node_modules/hwsim
Restart=always
Environment=PORT=80

[Install]
WantedBy=multi-user.target

Enable and Start the Service:

systemctl enable hwsim
systemctl start hwsim

Check Service Status:

systemctl status hwsim

4. Configure Firewall

If a firewall like UFW is enabled, allow access to port 80 (web) and 2101 (TCP server):

ufw allow 80/tcp
ufw allow 2101/tcp
ufw reload

5. Configure Reverse Proxy (Optional)

For better security and easier domain name usage, configure a reverse proxy using Nginx.

Install Nginx:

apt install nginx -y

Create a New Nginx Configuration:

nano /etc/nginx/sites-available/hwsim

Add the Following:

server {
    listen 80;
    server_name your-domain.com;

    location / {
        proxy_pass http://localhost:80;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Note: Replace your-domain.com with your actual domain name.

Enable the Configuration:

ln -s /etc/nginx/sites-available/hwsim /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx

6. Monitor Logs

Check Systemd Logs:

journalctl -u hwsim -f

7. Configuration

Access through a browser with the ip of the server, default on port 80. So just entering the ip is enough.