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

waybar-lazycrypto

v0.0.5

Published

A lightweight cryptocurrency price tracker with ASCII candle charts for Waybar status bar. Get real-time crypto prices and visual trend indicators right in your status bar.

Readme

waybar-lazycrypto

A lightweight cryptocurrency price tracker with ASCII candle charts for Waybar status bar. Get real-time crypto prices and visual trend indicators right in your status bar.

npm version license

Features

  • 📊 ASCII Candle Charts - Visual price trends using ASCII characters
  • 💰 Real-time Prices - Live cryptocurrency prices from KuCoin API
  • 🎨 Color Support - Optional color-coded price changes and indicators
  • ⏱️ Multiple Timeframes - Support for 1min to 1week intervals
  • 🚀 Lightweight - Minimal dependencies, fast execution
  • 🔧 Waybar Integration - Designed specifically for Waybar status bar

Installation

npm install -g waybar-lazycrypto

Or use directly with npx:

npx waybar-lazycrypto BTC color 1hour

Usage

Command Line

waybar-lazycrypto <symbol> [color] [timeframe]

Parameters:

  • symbol - Cryptocurrency symbol (BTC, ETH, ADA, DOT, SOL, etc.)
  • color - Optional. Add "color" to enable colored output
  • timeframe - Optional. Default: "1hour"

Examples:

# Basic usage
waybar-lazycrypto BTC

# With color support
waybar-lazycrypto BTC color

# With custom timeframe
waybar-lazycrypto ETH color 4hour

# Without color, custom timeframe
waybar-lazycrypto SOL 15min

Supported Timeframes

  • Minutes: 1min, 3min, 5min, 15min, 30min
  • Hours: 1hour, 2hour, 4hour, 6hour, 8hour, 12hour
  • Days/Weeks: 1day, 1week

Waybar Configuration

Add this to your Waybar config file (~/.config/waybar/config):

"custom/lazycrypto": {
    "exec": "npx waybar-lazycrypto BTC color 1hour",
    "interval": 300,
    "format": "{}",
    "return-type": "json",
    "on-click": "$TERMINAL -e npx lazycrypto-cli",
    "signal": 8,
    "on-click-right": "~/.config/waybar/cycle-timeframe.sh && pkill -RTMIN+8 waybar"
}

Dynamic Timeframe Configuration

For dynamic timeframe switching, you can read from a file:

"exec": "npx waybar-lazycrypto BTC color $(cat ~/.crypto-timeframe 2>/dev/null || echo '1hour')"

Create a script to cycle through timeframes (~/.config/waybar/cycle-timeframe.sh):

#!/bin/bash
TIMEFRAMES=("15min" "30min" "1hour" "4hour" "1day")
CURRENT=$(cat ~/.crypto-timeframe 2>/dev/null || echo "1hour")

for i in "${!TIMEFRAMES[@]}"; do
    if [[ "${TIMEFRAMES[$i]}" == "$CURRENT" ]]; then
        NEXT_INDEX=$(( (i + 1) % ${#TIMEFRAMES[@]} ))
        echo "${TIMEFRAMES[$NEXT_INDEX]}" > ~/.crypto-timeframe
        break
    fi
done

Output Format

Standard Output

BTC $45,234 +2.45% /\|C\//\\ 1hour

JSON Output (with color flag)

{
  "text": "<span>BTC</span> <span color=\"#ADD777\">$45,234</span> <span color=\"#ADD777\">+2.45%</span> /\\|C\\//\\\\ 1hour",
  "tooltip": "Candle Chart Legend:\nC = Highest close price\nc = Lowest close price\nh = Highest high price\nl = Lowest low price\nT = Highest close and high\nB = Lowest close and low"
}

Candle Chart Indicators

The ASCII candle visualization shows the last 12 candles with special indicators:

  • / - Price increased from previous candle
  • \ - Price decreased from previous candle
  • | - Price unchanged
  • C - Highest closing price in the window
  • c - Lowest closing price in the window
  • h - Highest high price in the window
  • l - Lowest low price in the window
  • T - Combined highest close and high (peak)
  • B - Combined lowest close and low (bottom)

Color Scheme

When color mode is enabled:

  • 🟢 Green (#ADD777) - Price increases, highs
  • 🔴 Red (#F96D7F) - Price decreases, lows
  • ⚪ Gray (#94a3b8) - Neutral/unchanged

API

Programmatic Usage

import { waybarLazyCrypto } from 'waybar-lazycrypto';

await waybarLazyCrypto({
  symbol: 'BTC',
  selectedTimeframe: '1hour',
  color: true
});

Error Handling

The package handles various error scenarios gracefully:

  • Connection errors - Shows "₿ Connection Error"
  • Rate limiting - Shows "₿ Rate Limited"
  • No data - Shows "Bitcoin No Data"
  • General errors - Shows "₿ Error"

Dependencies

  • axios - HTTP client for API requests
  • dotenv - Environment variable management

Requirements

  • Node.js >= 14.0.0
  • Waybar (for status bar integration)
  • Internet connection for real-time data

Data Source

Price data is fetched from the KuCoin Public API. No API key required.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © A1GoKn8t

Support

For issues, questions, or suggestions, please open an issue on the GitHub repository.

Changelog

v0.0.2

  • Added color support for Waybar JSON output
  • Improved candle chart visualization
  • Enhanced error handling

v0.0.1

  • Initial release
  • Basic price tracking functionality
  • ASCII candle charts