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

lrclib-fetcher-ts

v0.0.2

Published

Library for fetching synchronized lyrics for music files

Readme

LRCLib Fetcher

A TypeScript library and CLI tool for fetching synchronized lyrics from LRCLib.net for your music files.

Features

  • Batch Processing: Process multiple music files in parallel with configurable batch sizes
  • Metadata Extraction: Extract artist and title information from audio file metadata
  • Synchronized Lyrics: Prioritizes synchronized .lrc files over plain text lyrics
  • Smart Search: Multiple fallback strategies to find the best match for your music
  • File Management: Skip existing lyrics or overwrite as needed
  • Detailed Logging: Configurable logging levels for debugging

Installation

NPM Global Installation

npm install -g lrclib-fetcher-ts

Local Installation

npm install lrclib-fetcher-ts

CLI Usage

Basic Usage

Process a directory of music files:

lrclib /path/to/your/music

Command Line Options

Options:
  -r, --recursive                Scan directories recursively (default: true)
  --no-skip-existing             Don't skip files that already have lyrics
  -o, --overwrite                Overwrite existing lyrics files (default: false)
  -b, --batch-size <number>      Number of files to process in parallel (default: "5")
  -d, --delay <number>           Delay between API requests in milliseconds (default: "1000")
  --allow-title-only             Allow searching by title only if artist search fails (default: false)
  --prefer-synced                Prefer synchronized lyrics over plain text (default: true)
  --log-level <level>            Log level (debug, info, warn, error) (default: "info")
  --log-file <path>              Path to log file
  -h, --help                     Display help
  -V, --version                  Show version

Examples

# Process a directory with default settings
lrclib ~/Music

# Process with custom options
lrclib ~/Music --overwrite --batch-size 10 --delay 2000

# Only process files without existing lyrics
lrclib ~/Music --skip-existing

# Write logs to a file
lrclib ~/Music --log-level debug --log-file lyrics.log

Using with Docker

:::note this is a TODO area! havent finished yet! :::

Build the Docker image

docker build -t lrclib-fetcher .

Run with Docker

docker run -v "/path/to/your/music:/music" lrclib-fetcher

Using custom options with Docker

docker run -v "/path/to/your/music:/music" lrclib-fetcher /music --overwrite --batch-size 10

Programmatic Usage

import { createLyricsFetcher } from 'lrclib-fetcher-ts';

// Create a fetcher with custom options
const fetcher = createLyricsFetcher({
  logging: { 
    level: 'info',
    logToFile: false
  },
  search: {
    allowTitleOnlySearch: true,
    preferSynced: true
  },
  file: {
    skipExisting: true,
    overwriteExisting: false
  },
  batch: {
    enabled: true,
    size: 5,
    delayMs: 1000
  }
});

// Process a directory
fetcher.processDirectory('/path/to/music')
  .then(results => {
    console.log(`Processed ${results.length} files`);
    console.log(`${results.filter(r => r.success).length} successful`);
  })
  .catch(error => {
    console.error('Error:', error);
  });

API Reference

createLyricsFetcher(options)

Creates a new lyrics fetcher instance with the specified options.

processDirectory(directory, options)

Processes all audio files in the specified directory and its subdirectories.

Requirements

  • Node.js 16 or later
  • ffmpeg/ffprobe (automatically installed via ffprobe-static)

License

MIT

Acknowledgements

This project uses the unofficial LRCLib.net API as described in the API documentation. All lyrics are provided by LRCLib.net users.

Contributing

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Similar code found with 2 license types