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

subsonicjs

v0.6.0

Published

Subsonic API Wrapper

Readme

subsonicjs

NOTE: Alpha release; Will have basic functionality working soon.

npm version

An abstraction of the subsonic API as a node package. This package attempts to line up API methods and their parameters as close to 1:1 with the original documentation Official Subsonic API Docs.

Changelog

Changelog is available here: Changelog

Installation

npm install --save subsonicjs

Usage

The package needs to be configured with your subsonic username, a password token, and the salt used to generate the password token. To create a password token perform an md5 encryption of the password and salt. (e.g. salt = 'secret'; token = md5('password'+'secret');)

var subsonic = require("subsonicjs")(username, token, salt, url);

var pingServer = await subsonic.system.ping();

Initialize with config object

The package can also be configured with several options. The only required option is host all other options are optional.

var subsonic = require("subsonicjs")(username, token, salt, {
    protocol: 'http',
    host: 'www.subsonic.org',
    port: 80,
    timeout: 30,
    client: 'subsonicjs',
    version: '1.16.1'
});

| Option| Default | Description | | --- | --- | --- | | protocol | http | Protocol to connect to server. (e.g. http,https, etc ) | | host | null | Required. Host subsonic server which requests are made to. | | port | 80 | Port on subsonic server which requests are made to. | | timeout | 30 | Request timeout in seconds. | | client | subsonicjs | A unique string identifying the client application. | | version | 1.16.1 | Subsonic server API version to be used. |

Using Promises

Nearly every method returns a chainable promise which can be used.

subsonic.browsing
    .getIndexes()
    .then((indexes) => {
        let firstIndexedArtist = indexes.index[0].artist[0];
        return subsonic.browsing().getArtist(firstIndexedArtist.id);
    })
    .then((artist) => {
        //First artist details according to index order
    }).catch((err) => {
        // Handle error
    })

Promise Exceptions

A select few methods don't return promises as the end data object is not JSON but rather Binary. In these instances, the method will return a uri for the end client to consume.

subsonic.media.stream(id); //Will return stream uri for media player to consume
subsonic.media.getCoverArt(id); //Will return cover art uri for image components to consume

Optional Parameters

If a call has optional parameters, you can add them to the end of the method as an object.

subsonic.playlists
    .updatePlaylist(playlistId, {
        name: 'My Playlist',
        comment: 'My playlist description'
    })
    .then((response) => {
        //Handle response
    })

API Layout

The package has broken api calls out into different buckets for organization purposes. The following table contains the buckets and methods. Access methods through the following: subsonic.{bucket}.{method}(). Largely follows organization from official API docs, but some methods were moved to other areas.

| Bucket | Methods | | --- | --- | | bookmarks | getBookmarks, createBookmark, deleteBookmark | | browsing | getMusicFolders, getIndexes, getMusicDirectory, getGenres, getArtists, getArtist, getAlbum, getSong, getVideos, getVideoInfo, getArtistInfo, getArtistInfo2, getAlbumInfo, getAlbumInfo2, getSimilarSongs, getSimilarSongs2, getTopSongs, getAlbumList, getAlbumList2, getRandomSongs, getSongsByGenre, getNowPlaying, getStarred | | chat | getChatMessages, addChatMessage | | internetRadio | getInternetRadioStations, createInternetRadioStation, updateInternetRadioStation, deleteInternetRadioStation | | jukeboxControl | jukeboxControl | | media | stream, download, getCaptions, getCoverArt, getLyrics, getAvatar, star, unstar, setRating, scrobble | | playlists | getPlaylists, getPlaylist, createPlaylist, updatePlaylist, deletePlaylist | | playQueue | getPlayQueue, savePlayQueue | | podcasts | getPodcasts, getNewestPodcasts, refreshPodcasts, createPodcastChannel, deletePodcastChannel, deletePodcastEpisode, downloadPodcastEpisode | | searching | search2, search3 | | sharing | getShares, createShare, updateShare, deleteShare | | system | ping, getLicense, getScanStatus, startScan |