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 🙏

© 2024 – Pkg Stats / Ryan Hefner

muxamp

v1.1.3

Published

An playlist service for YouTube and SoundCloud streaming media

Downloads

8

Readme

Muxamp: A streaming media playlist for YouTube and SoundCloud

Muxamp is a web app that lets you play streaming media from YouTube and SoundCloud in your browser and save your platlists for later use.

Muxamp runs on Node.js. The client uses Backbone and jQuery to provide an interactive experience. Persistence is accomplished using MySQL (chosen out of pure laziness).

Features

  • Rich client-side playlist interaction: play, stop, pause, shuffle, and rearrange tracks
  • Serves playlists and search data through a RESTful API
  • Asynchronous server-side media and database queries through promises
  • Highly extensible client-side and server-side architecture

Browser Support

Muxamp supports recent versions of Chrome and Firefox. Internet Explorer probably won't work or has CSS problems I have not fixed. Older browsers are explicitly blocked in production mode.

Installation and Support

Requirements

  • Node.js >= 0.6.11 (older versions may work, or may not)
  • MySQL >= 5.0 using InnoDB engine

Installation

  1. npm install

  2. make install

    • If your database (specified in configuration) already has the tables that Muxamp needs to create, run make install force=true to overwrite these tables.

Configuration

Muxamp reads its user configuration through nconf, capable of taking in environment variables or an optional JSON config file located in ./config/<environment>.json. environment can be development, test, or production. You may also create a JSON file at ./config/all.json for configuration in any environment. All of these files are optional and are included in .gitignore by default.

Configuration structure

All namespaces are separated by colons (:). For instance the database host is set in muxamp:db:host.

  • muxamp
    • db
      • read: Is DB reading enabled (true by default, set to false for maintenance mode)
      • false: Is DB writing enabled (true by default, set to false for maintenance mode)
      • host: MySQL database host
      • database: MySQL database name
      • user: MySQL database user
      • password: MySQL database password
    • log: The logging level Muxamp uses (see express for logging level formats)
    • port: The port from which Muxamp serves (defaults to process.env['app_port'], then 3000)

Testing

Unit and integration tests can be found in ./tests and are run using mocha. To run these tests, execute make test.

Acceptance tests for the browser are found in ./publictest. To run these tests, run NODE_ENV=test npm start, then open your browser and visit http://localhost/<Muxamp port>. A better way of running acceptance tests is currently being explored through PhantomJS.

Server Libraries Used

Example

Muxamp is currently running at http://muxamp.com.

FAQ

Your early code is terrible

Sorry. I wrote Muxamp to learn JavaScript and Node.js, and when I started I had little experience with promises, callbacks, etc.

Why Backbone on the client side? Why not Meteor, Angular, or ?

I wanted to learn Backbone, so I chose to use it for this project.

Why does Muxamp store all the media it comes across in a database table called KnownMedia?

I want Muxamp to be as responsive as possible. Verifying each track at the time of playlist storage would make the server extremely unresponsive when saving a playlist, since the alternative (besides using a cache like Redis) would be to query YouTube, SoundCloud, etc. for every saved track! My solution is to verify each track when executing a search query, and then checking the database to see if it has a track when the playlist is saved.

Why does Muxamp store playlists as strings? Why not in a many-many relationship with a Tracks table? Are you #%^@$!* nuts?

I know it's kind of hacky, but it allows for quick dedup lookup of existing playlists. Take the SHA256 hash of the playlist string, search for it in the Playlists table, and don't insert anything if you get a result. Plus, the SHA256 column can be indexed.

Why not MongoDB?

I considered it, but I chose to go with a DBMS I already knew, since I have no experience to date with MongoDB.

Are you accepting patch requests?

Absolutely!

Future Plans

  • Support for more streaming media sources
  • Compatibility with older browsers
  • Consider revisions to database architecture