Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💻 laptop-check

NPM Version GitHub Repository

A zero-dependency CLI tool to verify a used Windows laptop's real hardware specs (CPU, RAM, GPU), health (Battery wear, SSD SMART data), display, network adapters, storage partitions, system/BIOS info, webcam/audio devices, thermal stress testing, and Windows activation status. Run it instantly via npx, or compile it to a standalone .exe for 100% offline usage on a USB stick.


Why?

When buying a used laptop you want to verify that the seller's claims match reality. Is the CPU actually an i7? How much RAM is really installed? Is the dedicated GPU alive? How degraded is the battery?

laptop-check answers all of those questions with a single command — no GUI tools to download, no clicking through tabs. Just run it and get a colour-coded pass/fail report. It also checks whether Windows is genuinely activated, verifies the display resolution and refresh rate, detects Wi-Fi/Bluetooth/Ethernet adapters, and shows how much storage is actually usable vs hidden in recovery partitions.

Quick Start

# Run directly with npx (Node 18+ required)
npx laptop-check

# Or install globally
npm install -g laptop-check
laptop-check

Windows only. This tool uses PowerShell and WMI queries that are only available on Windows. The package will refuse to install on macOS / Linux.

Usage

laptop-check [options]

Options:
  --cpu                     Run the CPU check only
  --ram                     Run the RAM check only
  --gpu                     Run the GPU check only
  --battery                 Run the battery health check only
  --ssd                     Run the SSD/NVMe health check only
  --activation              Run the Windows activation check only
  --display                 Run the display check only
  --network                 Run the network adapter check only
  --partitions              Run the storage partitions check only
  --system-info             Run the system/BIOS info check only
  --webcam-audio            Run the webcam and audio device check only
  --stress                  Run a 30-second CPU thermal stress test (opt-in only)
  --full                    Run all checks (default, excludes --stress)
  --expect-cpu <model>      Expected CPU model substring (case-insensitive)
  --expect-cores <n>        Expected physical core count (exact match)
  --expect-threads <n>      Expected logical thread count (exact match)
  --expect-ram <gb>         Minimum expected total RAM in GB (at-least)
  --expect-ram-speed <mhz>  Minimum expected RAM speed in MHz (at-least)
  --expect-ram-type <type>  Expected RAM type e.g. DDR4, DDR5 (case-insensitive substring)
  --expect-gpu <name>       Expected GPU name substring (case-insensitive)
  --expect-edition <edition> Expected Windows edition substring (case-insensitive)
  --expect-resolution <res> Expected display resolution e.g. "1920x1080" (exact match)
  --expect-refresh-rate <hz> Minimum expected refresh rate in Hz (at-least)
  --expect-wifi <standard>  Expected Wi-Fi standard substring e.g. "Wi-Fi 6" (case-insensitive)
  --expect-capacity <gb>    Expected physical storage capacity in GB (±5% tolerance)
  --expect-serial <serial>  Expected serial number / service tag (case-insensitive exact match)
  --no-update-check         Disable checking for newer versions on npm
  --profile <name>          Load expected specs from profiles/<name>.json
  --json <path>             Write a JSON report to the specified file path
  -V, --version             Output the version number
  -h, --help                Display help for command

Examples

# Full hardware report
laptop-check

# CPU and RAM only
laptop-check --cpu --ram

# Full check + save JSON report
laptop-check --full --json report.json

# Verify the seller claims it's an i7-10750H with 6 cores, 12 threads, 16 GB RAM
laptop-check --cpu --ram --expect-cpu "i7-10750H" --expect-cores 6 --expect-threads 12 --expect-ram 16

# Use a saved profile instead of typing all flags
laptop-check --full --profile dell-3550

# Override a single value from the profile
laptop-check --full --profile dell-3550 --expect-ram 32

# Check only activation status
laptop-check --activation

# Verify seller claims it's Windows 11 Pro
laptop-check --activation --expect-edition "Windows 11 Pro"

# Check display and verify it's really FHD 144Hz
laptop-check --display --expect-resolution "1920x1080" --expect-refresh-rate 144

# Verify Wi-Fi 6 and check storage partitions
laptop-check --network --partitions --expect-wifi "Wi-Fi 6" --expect-capacity 512

# Get system info and verify serial number matches the listing
laptop-check --system-info --expect-serial "5CD6434GZP"

# Check webcam and audio devices
laptop-check --webcam-audio

# Run a thermal stress test (30 seconds, opt-in only)
laptop-check --stress

Example Output (with spec comparison)

 💻 laptop-check   —  hardware health inspector
  Comparing against expected specs...

  CPU
    Model        : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz  ✗ MISMATCH  (expected: i7-10750H)
    Cores        : 2  ✗ MISMATCH  (expected: 6)
    Threads      : 4  ✗ MISMATCH  (expected: 12)
    Max Clock    : 2400 MHz

  RAM
    Total        : 20 GB  ✓ MATCH
    Type         : DDR4  ✓ MATCH
    Speed        : 2133 MHz  ✗ MISMATCH  (expected: 2933 MHz)
    Slot 1       : 16 GB @ 2133 MHz DDR4 — Hynix/Hyundai HMA82GS6MFR8N-TF
    Slot 2       : 4 GB @ 2133 MHz DDR4 — Samsung M471A5143EB0-CPB

  GPU
    GPU Name     : Intel(R) HD Graphics 520  ✗ MISMATCH  (expected: Quadro P620)
    VRAM         : 1 GB
    Driver       : 31.0.101.2111

  Battery
    Design Cap   : 32560 mWh
    Full Charge  : 10774 mWh
    Health       : 33.1%
    Cycle Count  : 537
    ✗ Battery health is 33.1% (threshold: 80%). The battery may need replacement.
    ✗ Battery cycle count is 537 (threshold: 200). High wear detected.

  SSD / NVMe
    ── Drive 1 ──
    Model        : SAMSUNG MZVLB512HBJQ-000L7
    Interface    : NVMe
    Capacity     : 512 GB
    Serial       : S4ENNF0M123456
    Health       : 98%
    Total Writes : 8.52 TB
    Temperature  : 42°C

  Activation
    Edition      : Windows 10 Pro  ✓ MATCH
    Build Number : 19045
    Version      : 10.0.19045
    Activation   : Activated
    slmgr        : The machine is permanently activated.

  Summary

    ✗ FAIL  CPU
    ✗ FAIL  RAM
    ✗ FAIL  GPU
    ✗ FAIL  Battery
    ✓ PASS  SSD
    ✓ PASS  Activation

  Display
    Resolution   : 1366x768  ✗ MISMATCH  (expected: 1920x1080)
    Refresh Rate : 60 Hz
    Panel Mfr    : CMN
    Panel Model  : 1495

  Network
    Wi-Fi        : Wi-Fi 5 (802.11ac)  ✗ MISMATCH  (expected: Wi-Fi 6)
    Adapter      : Intel(R) Dual Band Wireless-AC 8260
    Bluetooth    : Present (version undetermined) (inferred)
    Ethernet     : Present
    Eth Adapter  : Realtek PCIe GbE Family Controller

  Storage Partitions
    Physical Cap : 476.9 GB  ✓ MATCH
    Usable Cap   : 465.3 GB
    Free Space   : 312.1 GB
    Usable %     : 97.6%
    Drive        : SAMSUNG MZVLB512HBJQ-000L7 (476.9 GB)
    C:           : 465.3 GB total, 312.1 GB free
    ── Hidden Partitions (11.6 GB total) ──
    Recovery     : 0.5 GB
    System       : 0.1 GB

  Summary

    ✗ FAIL  CPU
    ✗ FAIL  RAM
    ✗ FAIL  GPU
    ✗ FAIL  Battery
    ✓ PASS  SSD
    ✓ PASS  Activation
    ✗ FAIL  Display
    ✗ FAIL  Network
    ✓ PASS  Partitions

  System / BIOS
    Manufacturer : HP
    Model        : HP ProBook 440 G3
    Serial       : 5CD6434GZP
    BIOS Version : N78 Ver. 01.62
    BIOS Date    : 2021-08-15
    ℹ Cross-check the serial number against the sticker on the chassis bottom.

  Webcam / Audio
    Camera       : HP HD Camera  OK
    Audio 1      : Conexant ISST Audio  OK
    Audio 2      : Intel(R) Display Audio  OK
    ℹ This check confirms the OS sees these devices. Still test the Camera app and a voice recording in person.

  Summary

    ✗ FAIL  CPU
    ✗ FAIL  RAM
    ✗ FAIL  GPU
    ✗ FAIL  Battery
    ✓ PASS  SSD
    ✓ PASS  Activation
    ✗ FAIL  Display
    ✗ FAIL  Network
    ✓ PASS  Partitions
    ℹ INFO  System Info
    ✓ PASS  Webcam/Audio

    ⚠ Remember to manually test the webcam (Camera app) and mic (Voice Recorder) during the physical inspection.

When no --expect-* flags are provided, fields display raw values without MATCH/MISMATCH annotations.

Red-Flag Thresholds

The tool flags potential problems using these thresholds (configurable in src/utils/thresholds.js):

Component Metric Red Flag Threshold
Battery Health % Below 80%
Battery Cycle Count Above 200
GPU Adapter Name Contains "Microsoft Basic Display Adapter"
SSD (v2) Health % Below 90%
SSD (v2) Total Writes Above 10 TB
SSD (v2) Temperature Above 50°C
CPU (v2) Temp under load Above 90°C
Activation LicenseStatus 0 (Unlicensed) or 5 (Notification/Non-Genuine) → ✗ RED FLAG
Activation LicenseStatus 2, 3, or 6 (Grace Periods) → ⚠ WARNING
Display Resolution Below --expect-resolution when provided → ✗ MISMATCH
Display Refresh Rate Below --expect-refresh-rate when provided → ✗ MISMATCH
Network Wi-Fi Standard Below --expect-wifi when provided → ✗ MISMATCH
Storage Usable % Below 90% of physical capacity (abnormal hidden partition usage)
Webcam Camera presence No webcam detected at all → ✗ RED FLAG
Webcam/Audio Device Status Any device reporting status other than "OK" → ✗ RED FLAG
Stress Test Peak Temperature Above 90°C (direct sensor) → ✗ RED FLAG
Stress Test Clock Speed Drop Sustained drop >30% during load → ⚠ WARNING (thermal throttling)

What Each Check Does

CPU (--cpu)

  • Queries Win32_Processor via WMI
  • Reports: model name, physical cores, logical threads, max clock speed
  • With --expect-cpu: case-insensitive substring match against detected model
  • With --expect-cores / --expect-threads: exact match (wrong count = different CPU)

RAM (--ram)

  • Queries Win32_PhysicalMemory via WMI
  • Reports: total installed RAM, generation (DDR3/DDR4/DDR5), and per-slot breakdown (capacity, speed, manufacturer, part number)
  • With --expect-ram: at-least comparison (detected ≥ expected = pass)
  • With --expect-ram-speed: at-least comparison (seller under-promising is fine)
  • With --expect-ram-type: case-insensitive substring match (e.g. "DDR4")
  • Flags mismatched RAM speeds (may prevent dual-channel)
  • Flags mismatched DDR generations across slots (indicates tampered SPD data)

GPU (--gpu)

  • Queries Win32_VideoController via WMI
  • Reports: adapter name, VRAM, driver version
  • With --expect-gpu: case-insensitive substring match against any detected adapter
  • CRITICAL FLAG: "Microsoft Basic Display Adapter" means the dedicated GPU is dead or has no driver

Battery (--battery)

  • Generates a battery report via powercfg /batteryreport
  • Parses: design capacity, full charge capacity, cycle count
  • Calculates health percentage — flags if below 80% or cycles above 200

SSD / NVMe (--ssd)

  • Uses smartctl to read real SMART wear-leveling data from NVMe and SATA drives
  • Requires Administrator privileges (will warn you if not elevated)
  • The tool operates 100% offline, reading data via the bundled vendor/smartctl binary
  • Reports: interface type, exact model name, health percentage, total terabytes written, and current temperature

Activation (--activation)

  • Queries SoftwareLicensingProduct via CIM for authoritative license status (LicenseStatus 0–6)
  • Runs slmgr /xpr as a secondary human-readable confirmation
  • Queries Win32_OperatingSystem for edition (Caption), version, and build number
  • No administrator privileges required — unlike the SSD check, activation check works even without elevation
  • Reports: Windows edition, build number, version, activation status (human-readable)
  • With --expect-edition: case-insensitive substring match against detected Caption (detects common misrepresentations like "Pro" vs "Home")
  • RED FLAG: LicenseStatus 0 (Unlicensed) or 5 (Notification/Non-Genuine)
  • WARNING: LicenseStatus 2, 3, or 6 (any grace period)

Display (--display)

  • Queries Win32_VideoController for resolution and refresh rate
  • Queries WmiMonitorID from root\wmi namespace for panel manufacturer and model name
  • Decodes WMI byte arrays (UINT16 char code arrays) to readable ASCII strings
  • No administrator privileges required
  • Reports: resolution, refresh rate, max refresh rate, panel manufacturer, panel model
  • Falls back gracefully when detailed panel info is unavailable (shows basic data with informational note)
  • With --expect-resolution: exact string match (e.g. "1920x1080")
  • With --expect-refresh-rate: at-least comparison (detected ≥ expected)

Network (--network)

  • Wi-Fi standard: Primary method is netsh wlan show drivers → parses "Radio types supported" for 802.11ax/ac/n mapping to Wi-Fi 6/5/4. Falls back to chipset name inference from adapter model string
  • Bluetooth: Queries Win32_PnPEntity for Bluetooth devices, extracts version from name where possible
  • Ethernet: Queries Win32_NetworkAdapter for physical Ethernet controllers (presence check only — doesn't assume link status)
  • No administrator privileges required
  • Fields labeled "(inferred)" in the report are best-effort detections from naming conventions, not guaranteed-accurate hardware-reported data
  • With --expect-wifi: case-insensitive substring match against detected standard

Storage Partitions (--partitions)

  • Queries Win32_DiskDrive for physical drive capacity across all installed drives
  • Queries Win32_LogicalDisk (DriveType 3 = local fixed disk) for usable/lettered partition sizes and free space
  • Queries Get-Partition for ALL partitions including hidden ones (Recovery, EFI System, Reserved)
  • No administrator privileges required
  • Reports: physical capacity, usable capacity, free space, usable percentage, per-drive breakdown, per-volume breakdown, hidden partition listing with types
  • With --expect-capacity: compares against physical capacity with ±5% tolerance (manufacturer GB/GiB rounding is normal and not flagged)
  • WARNING: Flags when usable percentage is below 90% — indicates unusually large hidden partitions

System / BIOS (--system-info)

  • Queries Win32_BIOS for serial number, BIOS version, and release date
  • Queries Win32_ComputerSystem for manufacturer, model, and system family
  • No administrator privileges required
  • This is informational data (status: ℹ INFO, not pass/fail) — it's reference data for manual cross-checking
  • Reports: manufacturer, model, system family, serial number/service tag, BIOS version, BIOS release date
  • Includes a reminder to cross-check the serial against the physical chassis sticker
  • With --expect-serial: case-insensitive exact match against the detected serial. Useful to confirm the machine shown matches the listing

Webcam / Audio (--webcam-audio)

  • Queries Win32_PnPEntity for imaging/camera devices and Win32_SoundDevice for audio controllers
  • Reports both presence and Status for each device (OK, Error, Degraded, Unknown)
  • No administrator privileges required
  • RED FLAG: No webcam detected at all — either missing, disabled in BIOS, or hardware fault
  • RED FLAG: Any camera or audio device with Status other than "OK"
  • Note: This check only confirms the OS/driver layer sees the device. It does NOT confirm image quality, actual video capture, or working audio. Always test the Windows Camera app and Voice Recorder manually during the physical inspection

Thermal Stress Test (--stress)

  • Opt-in only — never runs as part of --full, must be explicitly requested with --stress
  • Spawns one worker thread per logical CPU core, each running a CPU-bound busy loop for 30 seconds
  • Monitors temperature via MSAcpi_ThermalZoneTemperature (direct sensor, when available) or falls back to clock speed inference from Win32_Processor
  • Clearly labels the data source used: "Direct thermal sensor" vs "Clock speed inference" vs "No thermal data available"
  • Prints a visible warning before the test starts so the user isn't alarmed when fans spin up
  • RED FLAG: Peak temperature above 90°C (direct sensor reading)
  • WARNING: Clock speed drops >30% sustained for more than 10 seconds (indicates thermal throttling)
  • Workers are properly cleaned up on completion or Ctrl+C — no orphaned background load
  • May require Administrator privileges for the MSAcpi_ThermalZoneTemperature WMI query on some systems (falls back to clock speed if unavailable)

Spec Comparison

The --expect-* flags let you compare detected hardware against what the seller advertised:

Flag Comparison Rationale
--expect-cpu Substring (case-insensitive) Sellers often add extra text around the model
--expect-cores Exact match Wrong core count = different CPU entirely
--expect-threads Exact match Wrong thread count = different CPU entirely
--expect-ram At-least (≥) More RAM than claimed is fine
--expect-ram-speed At-least (≥) Faster RAM than claimed is fine
--expect-ram-type Substring (case-insensitive) E.g., "DDR4" or "DDR5"
--expect-gpu Substring (case-insensitive) Matches against any installed adapter
--expect-edition Substring (case-insensitive) Detects edition mismatches (e.g. "Pro" vs "Home")
--expect-resolution Exact match Lower resolution than claimed is always a red flag
--expect-refresh-rate At-least (≥) Higher refresh rate than claimed is fine
--expect-wifi Substring (case-insensitive) Detects Wi-Fi standard downgrades (e.g. "Wi-Fi 6" vs "Wi-Fi 5")
--expect-capacity ±5% tolerance Accounts for normal GB/GiB rounding differences
--expect-serial Exact (case-insensitive) Confirms the machine matches the listing's serial

Hardware Profiles

Save expected specs in a JSON file under profiles/ to avoid typing all flags every time:

// profiles/dell-3550.json
{
  "cpu": "i7-10750H",
  "cores": 6,
  "threads": 12,
  "ram": 16,
  "ramSpeed": 2933,
  "ramType": "DDR4",
  "gpu": "Quadro P620",
  "edition": "Windows 10 Pro",
  "resolution": "1920x1080",
  "refreshRate": 60,
  "wifi": "Wi-Fi 5",
  "capacity": 512,
  "serial": "ABC1234DEF"
}

Then run:

laptop-check --full --profile dell-3550

Individual --expect-* flags override profile values, so you can use a profile as a base and tweak one field:

# Profile says 16 GB RAM, but this unit was upgraded to 32 GB
laptop-check --full --profile dell-3550 --expect-ram 32

JSON Report

Use --json <path> to dump the full results as a JSON file. Useful for record-keeping when inspecting multiple laptops:

laptop-check --full --json "dell-xps-15-report.json"

The JSON includes all raw data returned by WMI, making it easy to script further analysis.

Building a Standalone EXE

You can compile the tool into a standalone offline distribution folder that runs on any Windows machine with zero dependencies and no internet access:

npm run build:exe

This uses pkg to bundle Node.js and all dependencies into a single binary targeting node18-win-x64.

Important: Distributing the tool means sharing the full dist/ folder, not just the .exe. The folder structure must look like this:

dist/
├── laptop-check.exe
└── vendor/
    └── smartctl/
        └── smartctl.exe

You can put this entire dist/ folder on a USB stick, plug it into a target laptop, and simply run laptop-check.exe. It works fully offline!

Project Structure

laptop-check/
├── package.json
├── bin/cli.js              → CLI entry point (commander setup)
├── profiles/
│   └── dell-3550.json      → Example hardware profile
├── src/
│   ├── checks/
│   │   ├── cpu.js          → CPU model, cores, threads
│   │   ├── ram.js          → RAM modules, total capacity, DDR type
│   │   ├── gpu.js          → GPU adapters, VRAM, driver
│   │   ├── battery.js      → Battery health, cycle count
│   │   ├── ssd.js          → SMART health, wear levels, temp
│   │   ├── activation.js   → Windows activation & edition check
│   │   ├── display.js      → Screen resolution, refresh rate, panel info
│   │   ├── network.js      → Wi-Fi standard, Bluetooth, Ethernet
│   │   ├── storage-partitions.js → Usable vs hidden partition space
│   │   ├── system-info.js  → Manufacturer, model, serial, BIOS
│   │   ├── webcam-audio.js → Camera & audio device detection
│   │   └── thermal-stress.js → CPU stress test & thermal throttle check
│   ├── utils/
│   │   ├── powershell.js   → PowerShell exec wrapper
│   │   ├── thresholds.js   → Red-flag threshold constants
│   │   ├── profile.js      → Profile loader (JSON → expectations)
│   │   ├── smartctl.js     → smartmontools downloader & locator
│   │   └── checkUpdate.js  → npm update notification
│   └── report.js           → Runs checks, prints formatted output
└── README.md

Requirements

  • Windows 10/11 (uses PowerShell 5.1+ and WMI)
  • Node.js 18+ (for npx or global install)
  • No additional tools needed — everything runs through built-in Windows commands

Permissions note: Only the SSD/SMART check (--ssd) requires Administrator privileges. The thermal stress test (--stress) may need elevation for direct temperature readings on some systems (falls back to clock speed inference if denied). All other checks work without elevation.

Why Windows Only?

This tool is purpose-built for the used-laptop market, where Windows machines dominate. The underlying data sources (Win32_Processor, Win32_PhysicalMemory, Win32_VideoController, powercfg) are all Windows-specific APIs with no cross-platform equivalent. Rather than providing a degraded experience on other platforms, the package enforces "os": ["win32"] in package.json.

License

MIT

About

A zero-dependency CLI tool to verify a used Windows laptop's real hardware specs (CPU, RAM, GPU) and health (Battery wear, SSD SMART data). Run it instantly via npx, or compile it to a standalone .exe for 100% offline usage on a USB stick.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages