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

sleep-compiler

v1.4.0

Published

Your personal sleep schedule compiler — log, analyze, and improve your sleep

Readme

sleep-compiler

npm License: MIT

Your personal sleep schedule compiler — log, analyze, and improve your sleep.

Track your sleep habits from the command line. All data stored locally in ~/.sleep-compiler/sleep.db.

Install

npm install -g sleep-compiler

Quick Start

# Start sleeping now, then finish when you wake up
sleep-compiler sleep now
sleep-compiler wake now

# Log last night's sleep
sleep-compiler log --sleep "23:30" --wake "07:15"

# View the last 7 days
sleep-compiler report --days 7

# See all-time stats
sleep-compiler stats

Commands

log

Log a sleep entry.

sleep-compiler log --sleep "23:30" --wake "07:15"
sleep-compiler log --sleep "00:15" --wake "08:00" --date "2024-03-14"
sleep-compiler log --sleep "22:00" --wake "06:30" --note "Took melatonin"

Options:

  • --sleep <HH:MM> — Bedtime in 24h format (required)
  • --wake <HH:MM> — Wake time in 24h format (required)
  • --date <YYYY-MM-DD> — Date to log (default: today)
  • --note <text> — Optional note

sleep now

Start a sleep session immediately and save it to ~/.sleep-compiler/pending-sleep.json.

sleep-compiler sleep now

wake now

Finish the active sleep session, log it to the database, and remove the pending file.

sleep-compiler wake now

If no pending sleep is active, the command prints:

Error: No pending sleep found. Run `sleep-compiler sleep now` first.

status

Show whether sleep tracking is currently active.

sleep-compiler status

report

Show a sleep report for the last N days.

sleep-compiler report
sleep-compiler report --days 14
sleep-compiler report --days 30 --json

Options:

  • --days <n> — Number of days to show (default: 7)
  • --json — Output raw JSON

Example output:

── Sleep Report (last 7 days) ──────────────────────
Date         Bedtime  Wake    Duration  Quality
2024-03-15   23:30    07:15   7h 45m    ✓
2024-03-14   00:15    07:00   6h 45m    ⚠ (< 7h)
2024-03-13   22:00    06:30   8h 30m    ✓

Average duration: 7h 40m
Consistency score: 82% (bedtime variance)

stats

Show all-time statistics.

sleep-compiler stats

Shows total entries, average/best/worst durations, best streak, worst week, and consistency score.

export

Export all data as CSV.

sleep-compiler export --format csv
sleep-compiler export --format csv > sleep_data.csv

Quality Thresholds

| Duration | Symbol | Label | |----------|--------|-------| | < 6h | ✗ | poor | | 6h–7h | ⚠ | short | | 7h–9h | ✓ | good | | > 9h | ○ | long |

Data Storage

All data is stored locally in SQLite at ~/.sleep-compiler/sleep.db. No cloud, no accounts.