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

nodecogs

v0.0.1

Published

A Discogs API v2.0 client

Downloads

2

Readme

Discogs API v2.0 Client

Build Status Total views

Nodecogs is a thin wrapper that gives you access to the Discogs API (Version 2.0).

Example Usage

Nodecogs asks that you identifying your application so be sure to set the userAgent. You are strongly encouraged to follow the conventions of RFC 1945

var NC = require('nodecogs');

// Initialize Nodecogs
var nc = new NC({userAgent:'my-awesome-app/0.0.1 ( http://my-awesome-app.com )'});

Setting a custom host, basePath and defaultPerPage (if not set, the defaultPerPage is 50);

var nc = new NC({host:'localhost', basePath:'/path/to/data/', defaultPerPage:100});

Resources

There are three main resources: Database, Marketplace and User. The current version of Nodecogs only supports the Database resource.

Database Resource

The Database resouce contains six resources:

  1. Artist
  2. Release
  3. Master
  4. Label
  5. Image
  6. Search

Artists

The artist resource represents a person in the Discogs database who contributed to a Release in some capacity.

nc.artist(1602787, function(err, response){
    console.log(response);
});

Returns a list of Releases and Masters associated with the artist. Accepts Pagination parameters.

nc.artistReleases(1602787, {page:2, per_page:10}, function(err, response){
    console.log(response);
});

If you do not include the pagination perameters, the page is 1 and the per_page is 50.

nc.artistReleases(1602787, function(err, response){
    console.log(response);
});

Release

The release resource represents a particular physical or digital object released by one or more Artists.

Look up a release:

nc.release(2113771, function(err, response){
    console.log(response);
});

Master

The master resource represents a set of similar Releases. Masters (also known as “master releases”) have a “main release” which is often the chronologically earliest.

nc.master(220990, function(err, response){
    console.log(response);
});

Retrieves a list of all Releases that are versions of this master. Accepts Pagination parameters.

nc.masterVersions(220990, function(err, response){
    console.log(response);
});

Label

The label resource represents a label, company, recording studio, location, or other entity involved with Artists and Releases. Labels were recently expanded in scope to include things that aren’t labels – the name is an artifact of this history.

nc.label(22532, function(err, response){
    console.log(response);
});

Returns a list of Releases associated with the label. Accepts Pagination parameters.

nc.labelReleases(22532, function(err, response){
    console.log(response);
});

Image

The Image resource represents a user-contributed image of a database object, such as Artists or Releases.

nc.image('A-1602787-1368176977-5588.jpeg', function(err, response){
    console.log(response);

    // "contentType": "image/jpeg",
    // "rateLimit": {
    //     "limit": "1000",
    //     "remaining": "955",
    //     "reset": "81631",
    //     "type": "image"
    // },
    // "image" : ... // Binary data
});

Search

The Search resource lists objects in the database that meet the criteria you specify.

nc.search({type:'release', country:'UK', page:2, per_page:3}, function(err, response){
    console.log(response);
});

Take into the power of Lucene search by using the q parameter.

nc.search({type:'release', q:'artist:t??l OR artist:afx AND -year:1997'}, function(err, response){
    console.log(response);
});

todo

  • Rate limits