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

space-vehicle-sensors

v2.0.1

Published

Een Node.js module voor het simuleren van sensoren en grondstoffen voor een ruimtevoertuig

Readme

Space Vehicle Sensors 🚀

Een Node.js applicatie voor het besturen van een ruimtevoertuig met verschillende sensoren en functies.

Functionaliteiten

  • 🔋 Batterij monitoring
  • 🌡️ Temperatuur metingen
  • 🚀 Bewegingscontrole
  • 📡 Sensor management
  • 💤 Slaapstand beheer

Basis Werking

De applicatie bestaat uit een server (backend) en een webinterface (frontend) voor het besturen van het ruimtevoertuig.

Server Endpoints

1. Status Check (GET /status)

Geeft de huidige status van het voertuig:

// Voorbeeld response
{
    direction: 'vooruit',
    isMoving: true,
    activeSensors: ['temperatuur', 'camera'],
    batteryPercentage: 85.5,
    temperature: -12.4
}

2. Actie Uitvoeren (POST /action)

Bestuurt het voertuig met verschillende commando's:

// Bewegingscommando
{
    action: 'move',
    direction: 'vooruit'
}

// Sensor beheer
{
    action: 'toggleSensor',
    sensor: 'temperatuur'
}

// Slaapstand beheer
{
    action: 'toggleSleep'
}

Belangrijke Functies

Bewegingscontrole

  • move: Beweegt het voertuig in een specifieke richting (vooruit, achteruit, links, rechts)
  • stop: Stopt alle beweging

Sensor Beheer

  • toggleSensor: Activeert of deactiveert specifieke sensoren
  • Beschikbare sensoren:
    • Temperatuur (🌡️): Meet omgevingstemperatuur (-50°C tot 50°C)
    • Camera (📸): Visuele waarnemingen
    • Druksensor (📊): Meet atmosferische druk
    • Stralingssensor (☢️): Meet stralingsniveaus

Slaapstand Management

  • toggleSleep: Schakelt tussen actieve en slaapstand
  • Slaat vorige status op bij slaapstand
  • Herstelt status bij ontwaken

Batterij Systeem

  • Simuleert batterijverbruik tijdens beweging en sensorgebruik
  • Laadt op tijdens slaapstand
  • Waarschuwt bij laag batterijniveau

Grondstof Detectie

  • Detecteert automatisch grondstoffen tijdens beweging
  • Mogelijke grondstoffen:
    • Water
    • Mineralen
    • Gesteente
    • IJs

Voorbeelden

Bewegingscommando

fetch('/action', {
    method: 'POST',
    body: JSON.stringify({
        action: 'move',
        direction: 'vooruit'
    })
});

Sensor Activeren

fetch('/action', {
    method: 'POST',
    body: JSON.stringify({
        action: 'toggleSensor',
        sensor: 'temperatuur'
    })
});

Status Updates

De frontend vraagt elke 5 seconden de status op van het voertuig:

setInterval(async () => {
    const response = await fetch('/status');
    const status = await response.json();
    updateInterface(status);
}, 5000);

Error Handling

De applicatie handelt verschillende fouten af:

  • Ongeldig commando
  • Voertuig in slaapstand
  • Sensor niet beschikbaar
  • Kritiek batterijniveau

Technische Vereisten

  • Node.js
  • Express.js
  • Modern web browser met JavaScript enabled

Installatie

npm install
npm start

De applicatie draait standaard op http://localhost:3000

License

ISC License