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

music-directory

v0.2.0

Published

Serve your music over the web with a nice UI, or as JSON

Downloads

18

Readme

music-directory

Serve your music over the web with a nice UI, or as JSON

still in beta, only tested on chrome

icon

Screenshots

about art pullmenu light

Installation

First, install Node.js. Then:

npm install -g music-directory

Usage

run md on the command line to fire up a server on 0.0.0.0 port 8080.

$ md
[2013-02-04T11:10:41.238Z] building cache...
[2013-02-04T11:10:41.573Z] build cache: 333ms
[2013-02-04T11:10:41.578Z] server started: http://0.0.0.0:8080/

By default, md will serve out of your current working directory. the above command will scan your current directory for music files, and build a local cache.

open a browser and navigation to http://localhost:8080 to see this site in action.

Usage: md [-d directory] [-c config]

Serve your music over the web with a nice UI, or as JSON

-c, --config <file>   optional config file to use, same as NODE_CONFIG env variable
-d, --dir <dir>       the music directory to expose, defaults to cwd
-h, --help            print this message and exit
-H, --host <host>     the host on which to listen, defaults to 0.0.0.0
-p, --port <port>     the port on which to listen, defaults to 8080
-u, --updates         check for available updates
-v, --version         print the version number and exit

Configuration

You may specify a config file to use with -c <file>. Any values in this config file will override the application defaults, but can be overridden still with command line arguments.

You can also specify the NODE_CONFIG env variable instead of passing in -c

config.json

{
  "web": {
    "host": "0.0.0.0",
    "port": 8080,
    "ssl": false,
    "key": "./my.key",
    "cert": "./my.crt"
  },
  "creds": {
    "user": "dave",
    "pass": "secret"
  },
  "music": "./"
}
web
  • web.host: the host on which to listen, defaults to 0.0.0.0
  • web.port: the port on which to listen, defaults to 8080
  • web.ssl: if this key is present and set to true, an SSL server will be used, defaults to false
  • web.key: if ssl is enabled, this attribute should be the path to a key file
  • web.cert: if ssl is enabled, this attribute should be the path to a cert file
creds
  • creds: if this key is present, authentication will be used (basic http auth)
  • creds.user: the username to use during authentication
  • creds.pass: the password to use during authentication

note: this is subject to change as a stronger form of authentication will be implemented

music
  • music: the music directory from which to server, can be overridden with -d <dir>, and defaults to the current working directory

SSL

Pass in a config file with web.ssl set to true to run an SSL server instead of a standard http server. You can easily generate a self-signed cert/key combo with the following commands

openssl genrsa -out my.key 4096
openssl req -new -x509 -days 1826 -key my.key -out my.crt

These 2 commands will create my.key and my.crt, which can be passed in with the config to fire up a secure server.

API

/

The main page, this is nice looking HTML for scanning and playing your music

/api/*

Various API calls

  • /api/cache: get the full recursive list of files (not directories) found
  • /api/cache/age: get the date the cache was created
  • /api/cache/rebuild: inform the server to rebuild the cache
  • /api/recent/<num>: grab the last <num> entries that have been recently modified, defaults to 20
  • /api/recent/all: grab all entries sorted by recently modified (mtime)

/media/*

Your media as it lives on the filesystem

  • /media/My Music: generate a simple HTML index page for your directory
  • /media/My Music?json=true: expose the directory as json
  • /media/My Music/mysong.mp3: stream an mp3
  • /media/My Music/mysong.mp3?tags=true: send the music tags as JSON
  • /media/My Music/mysong.mp3?art=true: send the embedded album art if present
  • /media/My Music/mysong.mp3?info=true: the info page as used by the UI

License

MIT