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

canary

v0.5.5

Published

a music streaming server with DAAP support

Readme

canary: a music streaming server/client

canary is a package consisting of a music streaming server and its companion iOS/web clients, built on DAAP. By using DAAP for streaming and mDNS/DNS-SD for service discovery, canary works seamlessly with Apple Music.

running canary with Apple Music

This document describes the server component. For the clients, refer to the files in the client directory.

Features

The server supports:

  • Compatibility with Apple Music or iTunes as a client
  • Scheduled rescanning of music files
    • Efficient change detection (only rescans modified or newly added files)
  • Password-based authentication
  • Smart and manual playlists
    • Playlists can be easily managed through the web UI
  • Streaming of MP3 and OGG files (if supported by the client)
  • Multiple directories for storing music

Performance

The initial scan is relatively fast thanks to the high performance of the music-metadata module. For example,

  • ~7 minutes for 5,000+ songs on a Gentoo system (Intel Atom D525, 4GB RAM and a 5400-rpm HDD)
  • ~1 minutes for subsequent rescans under the same conditions

The server tracks file modification times (mtime) and only processes files that have been added or changed.


Prerequisites

No external database is strictly required.

canary supports both:

  • A standalone database (NeDB)
  • MongoDB (recommended for large music libraries, because NeDB keeps indexed data in memory)

For service discovery, canary can use:

⚠️ Running multiple mDNS/DNS-SD services on the same machine may cause conflicts.

mDNS configuration options

The mdns setting in server.conf determines how service advertisement works:

  • avahi: uses avahi-publish-service
  • dns-sd: uses dns-sd
  • mdns-js: uses the built-in implementation
  • auto (default): tries avahi or dns-sd, falls back to mdns-js
  • off: disables service advertisement

Ensure avahi-publish-service or dns-sd is accessible in your system PATH if installed.


Configuration

Two configuration files are required:

  1. Server configuration (config/server.json)
  2. Database configuration (config/db.ne.json or config/db.mongo.json)
Example: config/server.json
{
    "name":     "canary music",
    "port":     3689,
    "runAs": {
        "uid": "userid",
        "gid": "groupid"
    },
    "password": "password",
    "scan": {
        "path":  [ "/path/to/mp3/files" ],
        "cycle": [ "17:00:00" ],
        "utc":   false
    },
    "db":    "neDB",
    "mdns":  "auto",
    "web":   true,
    "debug": false
}

Notes:

  • name: Advertised server name (visible to DNS-SD clients)
  • port: Must be 3689 for Apple Music compatibility
  • runAs: Drops privileges to specified user(uid)/group(gid) (recommended when starting as root)
  • password: Enables authentication if non-empty
    • path: directories containing music
    • cycle: rescan schedule
    • utc: whether to use UTC time
  • scan: controls file rescanning behavior
    • path: directories containing music
    • cycle and utc: define the rescan schedule. The format follows the ontime scheduling syntax. canary supports most ontime options, except single, which is always treated as true.
  • db: neDB or mongoDB
  • mdns: service discovery method
  • web: whether to serve the built web client from server/web/. Set to false to disable web UI serving entirely. If the directory does not exist, the server logs a warning and skips serving (DAAP and /api endpoints remain unaffected).
  • debug: enables verbose logging

Example: config/db.mongo.json
{
    "host":          "localhost",
    "port":          27017,
    "db":            "canary",
    "user":          "user",
    "password":      "password",
    "reconnectTime": 2
}
  • Authentication fields are optional
  • reconnectTime: retry interval (seconds) after disconnection

Example: config/db.ne.json
{
    "path": "db"
}

Specifies where NeDB stores its persistent files.


Running the server

Run the server like any Node.js application:

node server.js -c config/
  • -c or --config: specifies the configuration directory

Since version 0.2.2, canary can extract cover images. If upgrading from an older version, rebuild the database:

node server.js -c config/ --rebuild

To serve the web client from the same port, build it first:

cd ../client/web
npm install
npm run build

The server then serves the built artifacts at / (configurable via the web field in server.json). Without a build, the web UI is silently disabled while DAAP and /api endpoints continue to work.


Tested clients

If your client is not listed or does not work, please report the issue.


INSTALL.md explains how to build and install the library. For the copyright issues, see the accompanying LICENSE.md file.

If you have a question or suggestion, do not hesitate to contact me via email (woong.jun at gmail.com) or web (https://code.woong.org/).