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

@noirrzz/spacecraft-control

v1.0.1

Published

A spacecraft control system with power management and sensor capabilities

Readme

Spacecraft Control System

A comprehensive Node.js-based spacecraft control system featuring power management, movement controls, sensor systems, and real-time status monitoring.

Complete Setup Guide

Prerequisites

  • Node.js (v12 or higher)
  • npm (v6 or higher)

Project Setup

  1. Create a new directory and initialize:
mkdir spacecraft-control
cd spacecraft-control
npm init -y
  1. Install required dependencies:
npm install express body-parser
  1. Create the project structure:
spacecraft-control/
├── public/
│   ├── images/
│   │   └── rover.png
│   ├── styles/
│   │   └── styles.css
│   ├── scripts/
│   │   └── scripts.js
│   └── index.html
├── server.js
├── package.json
└── .npmignore
  1. Add to package.json:
{
  "name": "@noirrzz/spacecraft-control",
  "version": "1.0.0",
  "description": "A spacecraft control system with power management and sensor capabilities",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "dependencies": {
    "express": "^4.18.2",
    "body-parser": "^1.20.2"
  }
}

Features

🚀 Movement Control

  • Forward and backward movement at 200 km/h
  • Emergency stop functionality
  • Direction indicator
  • Automatic substance detection during movement

⚡ Power Management

  • Battery level monitoring
  • Sleep mode for instant recharging
  • Wake/Sleep state tracking
  • Power consumption during movement
  • Visual power level indicators

⛽ Fuel System

  • Fuel level monitoring
  • Refueling capability (+25% per refuel)
  • Fuel consumption during movement
  • Visual fuel level indicators

🔍 Sensor Systems

  • Mineral detection
  • Ground substance analysis
  • Real-time sensor readings
  • Activatable/Deactivatable sensors

API Reference

Endpoints

GET /status

Returns the current status of the spacecraft:

{
    "battery": "100%",
    "speed": "200 km/h (forward)",
    "fuel": "85%",
    "minerals": "Iron, Copper, Silicon",
    "groundSubstances": "Water, Methane",
    "status": "Awake"
}

POST /action

Send commands to control the spacecraft.

Available Actions:

  1. Movement Control
{
    "action": "move",
    "value": "forward" | "backward" | "stop"
}
  1. Power Management
{
    "action": "power",
    "value": "sleep" | "wake"
}
  1. Sensor Control
{
    "action": "sensors",
    "value": "on" | "off"
}
  1. Fuel Management
{
    "action": "fuel",
    "value": "refuel"
}

System Specifications

Power System

  • Full battery: 100%
  • Movement consumption: 5% per action
  • Wake-up consumption: 2%
  • Sleep mode: Instant recharge to 100%

Fuel System

  • Full tank: 100%
  • Movement consumption: 2% per action
  • Refuel amount: +25% per refuel
  • Cannot move when fuel is depleted

Movement System

  • Speed: 200 km/h
  • Directions: Forward/Backward
  • Emergency stop available
  • Requires both power and fuel to move

File Structure Details

server.js

Main server file handling:

  • Express server setup
  • API endpoints
  • Spacecraft state management
  • Action handlers

public/index.html

Frontend interface containing:

  • Control panel layout
  • Status displays
  • Interactive buttons
  • Progress bars

public/styles/styles.css

Styling including:

  • Layout and grid system
  • Color schemes
  • Animations
  • Responsive design

public/scripts/scripts.js

Frontend logic handling:

  • API calls
  • Status updates
  • UI animations
  • Error handling

Publishing to npm

  1. Login to npm:
npm login
  1. Create .npmignore:
.git
.gitignore
node_modules
.env
.DS_Store
  1. Publish package:
npm publish --access public

Usage Example

// Move forward
fetch('/action', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
        action: 'move',
        value: 'forward'
    })
});

// Enter sleep mode to recharge
fetch('/action', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
        action: 'power',
        value: 'sleep'
    })
});

Running the Project

  1. Start the server:
npm start
  1. Access the control panel:
http://localhost:3000

Error Handling

The system provides clear error messages for:

  • Insufficient power
  • Insufficient fuel
  • Sleep mode movement attempts
  • Invalid commands
  • System state conflicts

Author

noirrzz