
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
spotify-client
Advanced tools
SDK written in ECMAScript 6. Allows you to use (almost) all [Spotify Web API](https://developer.spotify.com/web-api/) endpoints.
SDK written in ECMAScript 6. Allows you to use (almost) all Spotify Web API endpoints.
###Diagram
Find (by id)
Artist.find( '7Ey4PD4MYsKc5I2dolUwbH' )
.then( ... );
Search all results
Artist.where( 'aerosmith' )
.then( ... );
Get several items by id
Album.several(['41MnTivkwTO3UUJ8DrqEJJ','6JWc4iAiJ9FjyK0B59ABb4','6UXCm6bOO4gFlDQZV5yL37'])
.then( ... );
Set search parameters
//optional search modifiers
let config = {
limit: 2,
offset: 0,
or: 'Rolling Stones',
market: 'US'
};
Artist.where('aerosmith',config)
.then( ... );
import {User,Session} from 'spotify-client';
Session.config({
clientId: 'your client ID',
secretId: 'your secret ID',
scopes: ['playlist-modify-public'],
redirect_uri: 'http://localhost:3000/demo/'
});
let token = window.location.hash.split('&')[0].split('=')[1];
if( token ){
Session.token = token;
} else {
Session.login().then( url => {
window.location.href = url;
});
}
User.findMe().then( me => {
console.log(`I am: ${me.display_name}`);
});
Get proper entity, not json
Artist.find( '7Ey4PD4MYsKc5I2dolUwbH' )
.then( artist => {
//get top tracks for this artist in the US
artist.getTopTracks( 'US' )
.then( trackList => {
//each element is an object of class Track
//so you can get human-readable duration for the current track
for( let track of trackList ){
console.log(
`${ track.name } (${ track.duration })`
);
}
});
});
###All entities find
/**
* Finds an entity by its Spotify ID.
* @param {string} id Spotify ID.
* @return {Promise}
*/
Artist.find('Spotify ID')
.then(success, fail);
where
/**
* Starts a query with the given parameter.
* @queryString {string} queryString A string to find by q parameter
* @params {object} params A plain object with advanced search options
* @return {Promise}
*/
Artist.where('string to search', { exactMatch: true })
.then(success, fail);
get
/**
* Obtains a full (instead of simplified) object from source.
*/
Track.find('Spotify ID')
.then( track => {
track.get();//loads full object
});
###Artist getTopTracks
/**
* Retrieves the top-tracks for the artist.
* @param {string} country The country for the search (ISO 3166-1 alpha-2 country code)
* @return {Promise}
*/
artist.getTopTracks( 'BR' )
.then(success, fail);
albums
/**
* Initializes a conditional query for the artist's albums.
* @return {Browser}
*/
artist.albums()
.all().then(success, fail);
git clone git@github.com:Cosmitar/spotify-client.git
npm install
gulp watch
Open the localhost:3000/demo/index.html and look for console.logs
##Installation
add package.json
dependency "spotify-client": "latest"
run
npm install
import {Artist,Album,Track,User,Playlist,Session} from 'spotify-client';
FAQs
SDK written in ECMAScript 6. Allows you to use (almost) all [Spotify Web API](https://developer.spotify.com/web-api/) endpoints.
The npm package spotify-client receives a total of 2 weekly downloads. As such, spotify-client popularity was classified as not popular.
We found that spotify-client demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.