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

js_ts_discogs_api_v2_library

v0.0.3

Published

TS / JS Library for Discogs API v2 Access.

Downloads

23

Readme

TS/JS Discogs APIv2 Library Version 0.0.3

Tool to talk to Discogs API V2

Currently, Only Supports Personal Access Key.

Installation

This library is libraried on NPM, to install, execute the command :

npm i js_ts_discogs_api_v2_library

Add the following to your .env file (or create a new one)

Exclude sections in []

DISCOGS_API_TOKEN="" [This is Your Personal Access Token, get one here : https://www.discogs.com/settings/developers and click "Generate New Token", Paste the token here] DISCOGS_USER_NAME = "" [Your Discogs UserProfile Name] DISCOGS_CURRENCY_MARK = "" [Options are : USD GBP EUR CAD AUD JPY CHF MXN BRL NZD SEK ZAR - per Discogs API] DISCOGS_PER_PAGE=500 [In Testing 500 is the maximum successful, default is 50, change this to your desired number, 500 or less.]

Roadmap

v0.0.1 only support GET endpoints

v0.0.2 adds Auto Rate-Limiting

v0.0.3 adds Search capability Current Version

v0.0.4 will add PUT, POST, DELETE endpoints.

v0.0.5 will add oAuth Support

v0.0.6+ will add user suggestions, and further enhancements, including adding CSV Import.

Additional Modules, Additional Functionality (Currently In Development)

Complete:

Currently None

Currently In Development:

For A Personal DB Interface use TSDiscogsTool-DBInterface (Requires this library) this will create a user updatable Prisma which you can link to your database backend of choice, or Supabase (TBD) basic database schema, and makes all the Database API endpoints available.

Yet To Be Started:

For Playlist creation use TSDiscogsTool-Playlists (Requires TSDiscogsTool-DBInterface et al) this will allow you to create custom playlists, for display on a website.

For Review creation use TSDiscogsTool-Reviews (Requires TSDiscogsTool-DBInterface et al) this will allow you to create reviews, for display on a website. [Potentially will allow posting of review to the relevant discogs release.]

For Shop Management use TSDiscogsTool-Shop (Requires TSDiscogsTool-DBInterface et al) this will give you access to all the Marketplace Endpoints.

We would like to manage some kind of marketplace searching, which is currently not supported natively by the API, how it will be possible, at the moment we don't know, but we will work on this.

To Display Full Headers

console.log(data.headers)

To Display RateLimit Information

console.log(discogs.getRatelimit());

Access Endpoints

Users should set Discogs Username in .env file

Discogs Personal Access Key should be set in .env file

USER INFORMATION

const user = await discogs.getUser();

const collection = await discogs.getUserCollection();

const wantlist = await discogs.getUserWantlist();

const folders = await discogs.getUserFolders();

const folderContents = await discogs.getUserFolderContents("#"); # = FolderID As In Your Custom Folders in Discogs Dashboard

const collectionValue = await discogs.getUserCollectionValue();

RELEASE INFORMATION

const releaseDetails = await discogs.getRelease("249504"); //RICK-ROLL (same as Official Docs)

const releaseUserRating = await discogs.getReleaseUserRating("249504");

const releaseCommunityRating = await discogs.getReleaseCommunityRating( "249504" );

const releaseStats = await discogs.getReleaseStats("249504");

const releaseMaster = await discogs.getMasterRelease("96559");

const releaseMasterVersions = await discogs.getMasterReleaseVersions("96559");

ARTIST INFORMATION

const artist = await discogs.getArtistDetails("72872"); //RICK ASTLEY

const artistReleases = await discogs.getArtistReleases("72872");

LABEL INFORMATION

const label = await discogs.getLabelDetails("895"); //RCA

const labelReleases = await discogs.getLabelReleases("895");

Suggestions, Updates & Errors

If you choose to use this library, and run into a problem, please log an issue or raise a PR, we are committed to this project in the long term and will act on all Issues promptly.

If you have suggestions for further functionality that is not already in the roadmap, please raise an Issue, we will add it to the list.

Thanks

Thanks go out to Mike Elsmore. Without your help and support this project would never have got off the ground.

Thanks go to Discogs for enabling an API

Thanks go to Bartve for Disconnect which although now unsupported, is a great library. Disconnect was part of the inspiration for this Library.

Thanks go to Joalla for Disgogs_Client which was part of the inspirtion for this library. I used this library extensively when I created a Python / Django version of the VinylVault Website

License

MIT

Other Resources

Discogs API Documentation

RichCodesWeb on Twitch - I live stream here most days writing code, it is where the development of this is being completed, as well as other projects.
Come ask me questions, and / or make suggestions in livechat to shape further development of this library and add-on modules.