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

nodebrainz

v2.1.1

Published

A MusicBrainz JSON Web Service Version 2 client

Downloads

265

Readme

Another Musicbrainz Node Client

Build Status Total views

NodeBrainz is a thin wrapper that gives you full access to the MusicBrainz API (Version 2). This includes search, lookup and browse. It has zero dependences, consumes only JSON (no blocking XML parsing), and includes a powerful Lucene search feature.

Example Usage

MusicBrainz asks that you identifying your application so be sure to set the userAgent. You may consider following the conventions of RFC 1945

var NB = require('nodebrainz');

// Initialize NodeBrainz
var nb = new NB({userAgent:'my-awesome-app/0.0.1 ( http://my-awesome-app.com )'});

Setting a custom host, basePath, port and defaultLimit (if not set, the defaultLimit is 25 and port is 80);

var nb = new NB({host:'localhost', port:8080, basePath:'/path/to/data/', defaultLimit:50});

Also supported are automatic retries for Musicbrainz rate-limiting.

var nb = new NB({retryOn: true, retryDelay: 3000, retryCount: 3});

MusicBrainz Entities

There are eight entities: artist, label, recording, release, release-group, work, area, url

Lookup

Lookups can be preformed on any of the eight entities.

Lookup an artist and include their releases, release-groups and aliases

nb.artist('e0140a67-e4d1-4f13-8a01-364355bee46e', {inc:'releases+release-groups+aliases'}, function(err, response){
    console.log(response);
});

Lookup a release-group with no filtering or subqueries

nb.releaseGroup('df46f245-7f62-4982-9d2c-e83d7be91cbf', function(err, response){
    console.log(response);
});

There are different subqueries you can include depending on the entities.

  • Arists - recordings, releases, release-groups, works
  • Label - releases
  • Recording - artists, releases
  • Release - artists, labels, recordings, release-groups
  • Release-group - artists, releases

Check out the some of the additional subqueries. Note that the number of linked entities returned is always limited to 25, if you need the remaining results, you will have to perform a browse or search.

Browse

Browse requests are a direct lookup of all the entities directly linked to another entity. For example, if you wanted to look up all the release-groups for a particularly talented artist:

nb.browse('release-group', {artist:'e0140a67-e4d1-4f13-8a01-364355bee46e'}, function(err, response){
    console.log(response);
});

Browsed entities are always ordered alphabetically by gid. If you need to sort the entities, you will have to fetch all entities and sort them yourself. For pagination, set a limit and offset.

nb.browse('release-group', {artist:'e0140a67-e4d1-4f13-8a01-364355bee46e', type:'album', limit:2, offset:1}, function(err, response){
    console.log(response);
});

Note that browse requests are not searches, in order to browse all the releases-groups for an artist, you need to provide the MBID for the artist.

Search

Provides a way to search for entities. Behind the scenes, results are provided by a search server using Lucene technology.

nb.search('artist', {artist:'tool', country:'US'}, function(err, response){
    console.log(response);
});

Search Fields

There are different search fields depending on the entity.

Search for all releases for the artists named pink floyd. Limited to 20 and offset by 5

nb.search('release', {artist:'pink floyd', limit:20, offset:5}, function(err, response){
  console.log(response);
});

Search for all the studio albums for a specific artist (identified by their artist ID)

nb.search('release-group', {arid:'e0140a67-e4d1-4f13-8a01-364355bee46e', type:"album"}, function(err, response){
  console.log(response);
});

Lucene Search

Create powerful queries using luceneSearch. View the syntax guide

nb.luceneSearch('artist',{query:'artist:t??l AND -artist:"Jethro Tull"', limit: 2, offset: 1}, function(err, response){
  console.log(response);
});

NPM