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

enhanced-spotify-api

v1.1.9

Published

Object-oriented library to work with Spotify's API. Includes wrapper for regular endpoints and additional functionality and grouping of requests.

Downloads

94

Readme

Overview

enhanced-spotify-api is an Object-Oriented API Wrapper aimed to make Spotify's API development fun and painless.

Spend more of your time coding something cool, and less time scouring over documentation.

Table of Contents

Official Website / Documentation

Features

Object oriented wrapper with classes for tracks, artists, playlists, and more

  • Member functions for all relevant endpoints
  • Automatic retrieval of data when needed
  • Minimizing requests made

Providing all the original functionality of spotify-web-api-node.

  • Added missing endpoints for shows and episodes (Just released 3/2020)
  • Fixed known bugs

Add and Override methods

  • Customize to your hearts content
  • I don't know what you need it for, so do your thing my dude.

Quick Start

Via command line

$ npm i enhanced-spotify-api

Import either the entire library

var EnhancedSpotifyAPI = require('enhanced-spotify-api');
EnhancedSpotifyAPI.setAccessToken( myAccessToken );

Or deconstruct what you need

var { Track } = require('enhanced-spotify-api');
Track.setAccessToken( myAccessToken );

All classes have the same authorization methods.

Applying a Spotify access token to one class will authorize the entire library and will not need to be called again.

Instantiate and play!

var playlistID = '6Ibg2aBUp5NP0lAujEGa6p';
var playlist = new Playlist( playlistID );

var tracks = playlist.getTracks();
tracks.play();

var size = playlist.size();

See the official website for more information.

Example

var { Track } = require('enhanced-spotify-api');
Track.setAccessToken( myAccessToken );

var trackID = '3HKpZgez8S4TS2F0sWLvAR';
var track = new Track( trackID );

console.log('My favorite song is', ( await track.getFullObject() ).name);

track.play();

var artists = track.getArtists();

var artist = artists.get(0);

var topTracks = artist.getTopTracks();

Available Classes

Instance and static methods for all endpoints relevent to each item

  • Track
  • Artist
  • Album
  • Playlist
  • Show
  • Episode
  • User
  • Playback
  • Tracks
  • Artists
  • Albums
  • Playlists
  • Shows
  • Episodes
  • Categories