![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@nechlophomeriaa/spotify-finder
Advanced tools
A isomorphic Spotify client, that use the Client Credentials authorization flow. It allows to use some Spotify Web API endpoints.
$ npm install spotify-finder
import Spotify from 'spotify-finder'
const client = new Spotify({
consumer: {
key: 'YOUR_CLIENT_ID', // from v2.1.0 is required
secret: 'YOUR_CLIENT_SECRET' // from v2.1.0 is required
}
})
Note: you have that provide the client credentials because from 29th May 2017 was removed unauthenticated calls to the Spotify Web API more info. Create an application in Spotify click here.
const params = {
q: 'Demi', // required
}
client.search(params)
.then(data => {
// do something with data
})
const params = {
q: 'Stone Cold', // required
type: 'artist', // optional for default 'artist,album,track'
limit: 5 // optional for default 20
}
client.search(params)
.then(data => {
// do something with data
})
const params = {
to: 'new-releases', // required
limit: 5, // optional for default 20
offset: 5 // optional for default 0
}
client.browse(params)
.then(albums => {
// do something with album's
})
client.browse({ to: 'featured-playlists' })
.then(playlists => {
// do something with playlist's
})
client.browse({ to: 'categories' })
.then(categories => {
// do something with categories
})
client.getCategory('toptrack')
.then(category => {
// do something with category
})
const params = {
playlists: true, // required
limit: 5, // optional for default 20
offset: 5, // optional for default 0
country: 'BR' // optional for default 'SE'
}
client.getCategory('toptrack', params)
.then(playlists => {
// do something with playlists
})
client.getAlbum('41MnTivkwTO3UUJ8DrqEJJ', { tracks: false })
.then(album => {
// do something with album
})
client.getAlbum('41MnTivkwTO3UUJ8DrqEJJ', { tracks: true })
.then(tracks => {
// do something with tracks
})
const ids = ['41MnTivkwTO3UUJ8DrqEJJ', '6UXCm6bOO4gFlDQZV5yL37']
client.getAlbums(ids)
.then(albums => {
// do something with albums
})
client.getArtist('6S2OmqARrzebs0tKUEyXyp')
.then(artist => {
// do something with artist
})
const params = {
albums: true, // required
album_type: 'album,single', // optional for default all types
limit: 5, // optional for default 20
offset: 5 // optional for default 0
}
client.getArtist('6S2OmqARrzebs0tKUEyXyp', params)
.then(albums => {
// do something with albums
})
client.getArtist('6S2OmqARrzebs0tKUEyXyp', { topTracks: true })
.then(tracks => {
// do something with tracks
})
client.getArtist('6S2OmqARrzebs0tKUEyXyp', { relatedArtists: true })
.then(artists => {
//do something with artists
})
const ids = ['15deb326635d69d0505434', '934da7155ec15deb32663'],
client.getArtists(ids)
.then(artists => {
//do something with artists
})
client.getTrack('934da7155ec15deb32663')
.then(track => {
//do something with track
})
const ids = ['15deb326635d69d0505s', 'da7155ec15deb326635d69d']
client.getTracks(ids)
.then(tracks => {
//do something with tracks
})
FAQs
A isomorphic Spotify API client
The npm package @nechlophomeriaa/spotify-finder receives a total of 59 weekly downloads. As such, @nechlophomeriaa/spotify-finder popularity was classified as not popular.
We found that @nechlophomeriaa/spotify-finder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.