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

terminal-music-player

v1.0.5

Published

A terminal-based music player that streams from YouTube

Readme

🎵 Terminal Music Player

A sleek command-line music player that streams music directly from YouTube Music. Built with Node.js for music lovers who prefer the terminal experience.

Version Node License

✨ Features

  • 🔍 Search & Stream: Search and play music directly from YouTube
  • 📋 Playlist Management: Create and manage playlists on-the-fly
  • ⏯️ Playback Controls: Play, pause, next, previous, and stop
  • 🎯 Auto-play: Automatically plays next track in playlist
  • 🎨 Beautiful Interface: Colorful and intuitive terminal interface
  • 🔄 Loop Support: Seamlessly loops through your playlist
  • 📊 Track Information: Display current track details and duration
  • 🚀 Auto MPV Installation: Automatically installs MPV media player during setup

🎬 Demo

┌─────────────────────────────────────┐
│         CLI Music Player           │
├─────────────────────────────────────┤
│ ▶ Search and play music           │
│   Show current playlist            │
│   Now playing                      │
│   Play next track                  │
│   Play previous track              │
│   Stop playback                    │
│   Exit                             │
└─────────────────────────────────────┘

📋 Prerequisites

📦 Node.js

Make sure you have Node.js version 18.0.0 or higher installed:

node --version

If you need to install Node.js, visit nodejs.org

🎵 MPV Media Player (Auto-Installed)

This application requires MPV media player for audio playback. MPV will be automatically installed during package installation on most systems.

Supported automatic installation methods:

  • Linux: apt-get, dnf, yum, pacman
  • macOS: Homebrew
  • Windows: Chocolatey, Scoop, Winget

If automatic installation fails, you can:

  1. Run the manual installer: npm run install-mpv
  2. Install MPV manually (see manual installation section below)

🚀 Installation

Global Installation (Recommended)

npm install -g terminal-music-player

During installation, the setup will:

  1. ✅ Check system requirements
  2. 🔍 Check if MPV is already installed
  3. 📦 Automatically install MPV if needed
  4. ✅ Verify installation

Local Installation

npm install terminal-music-player

Manual MPV Installation (if needed)

If automatic installation fails, you can install MPV manually:

# If installed globally
npm run install-mpv

# If installed locally
npx terminal-music-player install-mpv

🐧 Linux (Ubuntu/Debian)

sudo apt update
sudo apt install mpv

🐧 Linux (Fedora/RHEL/CentOS)

sudo dnf install mpv
# or for older versions:
sudo yum install mpv

🐧 Linux (Arch Linux)

sudo pacman -S mpv

🍎 macOS

Using Homebrew (recommended):

brew install mpv

Using MacPorts:

sudo port install mpv

🪟 Windows

Option 1: Using Chocolatey (Recommended)

choco install mpv

Option 2: Using Scoop

scoop install mpv

Option 3: Using Winget

winget install mpv-player.mpv

Option 4: Manual Installation

  1. Download MPV from https://mpv.io/installation/
  2. Extract the archive to a folder (e.g., C:\mpv)
  3. Add the MPV folder to your system PATH environment variable

🎯 Usage

Global Installation

Simply run:

tmusic

Local Installation

npx terminal-music-player

🎮 How to Use

  1. Launch the application: Run tmusic in your terminal
  2. Search for music: Select "Search and play music" and enter your search query
  3. Select a track: Choose from the search results
  4. Control playback: Use the menu options to control playback:
    • Next/Previous: Navigate through your playlist
    • Now Playing: See current track information
    • Show Playlist: View your current playlist
    • Stop: Stop current playback
    • Exit: Quit the application

🎵 Example Workflow

$ tmusic

CLI Music Player

? Music Player Menu (Use arrow keys)
❯ Search and play music
  Show current playlist
  Now playing
  Play next track
  Play previous track
  Stop playback
  Exit

? Enter search query: bohemian rhapsody queen

? Select a track to play: (Use arrow keys)
❯ Bohemian Rhapsody - Queen (5:55)
  Bohemian Rhapsody (Remastered 2011) - Queen (5:54)
  Queen - Bohemian Rhapsody (Official Video) - Queen (5:55)
  Cancel

Now Playing: Bohemian Rhapsody - Queen
Duration: 5:55

🔧 Troubleshooting

MPV Not Found Error

If you get an "MPV not found" error:

  1. Try automatic installation:

    • Restart the music player: tmusic
    • It will prompt you to install MPV automatically
    • Or run manual installer: npm run install-mpv
  2. Verify MPV installation:

    mpv --version
  3. Check PATH: Make sure MPV is in your system PATH

    • Linux/macOS: Add MPV location to ~/.bashrc or ~/.zshrc
    • Windows: Add MPV folder to Environment Variables PATH
  4. Manual installation: Follow the manual installation instructions above

Installation Issues

  • Permission denied: Run with appropriate permissions for your package manager
  • Package manager not found: Install a supported package manager first
  • Network issues: Ensure stable internet connection during installation
  • Antivirus blocking: Some antivirus software may block automatic installations

Network Issues

  • Ensure you have a stable internet connection
  • Some regions may have restrictions on YouTube access
  • Try using a VPN if you encounter access issues

Audio Issues

  • Check your system's audio settings
  • Ensure your audio drivers are up to date
  • Test MPV directly: mpv https://www.youtube.com/watch?v=dQw4w9WgXcQ

Permission Issues (Linux/macOS)

If you get permission errors:

sudo chown -R $(whoami) ~/.npm

⚠️ Legal Disclaimer

This tool is for educational and personal use only. Please respect YouTube's Terms of Service and copyright laws. The authors are not responsible for any misuse of this software.

🔗 Links

🙏 Acknowledgments

📊 Stats

  • Package Size: < 1MB
  • Dependencies: Minimal and secure
  • Platform Support: Windows, macOS, Linux
  • Node.js: >= 18.0.0

Made with ❤️ for music lovers who live in the terminal.

Happy Listening! 🎧