Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cody-music
Advanced tools
Control Spotify and iTunes, currently only on Mac OSX with NodeJS.
$ npm install @software/music
$ npm test
Play a track with Music URI uri
.
Specify either "Spotify" or "iTunes" (case-insensitive).
const music = require("@software/music");
// get the track info using get state
music.getState("iTunes").then(state => {
// - "genre" will be empty from Spotify
// - duration is in milliseconds
// {artist, album, genre, disc_number, duration, played_count, track_number, id, name, state}
console.log(state);
});
// play a specific spotify track
music
.playTrack("Spotify", "spotify:track:2YarjDYjBJuH63dUIh9OWv")
.then(result => {
// track is playing
});
// play an iTunes track number
music.playTrack("iTunes", 1).then(result => {
// track is playing
});
// handling errors
music.playTrack("iTunes", 1000000000).then(result => {
// result will contain the "error" attribute with the error message
if (result.error) {
console.log(`Unable to play track, error: ${result.error}`);
}
});
Resume playing current track.
Pause playing track.
Toggle play.
Play next track.
Play previous track.
Turn volume up.
Turn volume down.
Sets the volume.
music.setVolume("Spotify", 42).then(() => {
music.getState(state => {
console.log(state.volume);
});
});
Reduces audio to 0, saving the previous volume.
Returns audio to original volume.
Check if the music player is running.
music.isRunning("Spotify").then(isRunning => {
console.log(isRunning); // true || false
});
Is repeating on or off?
music.isRepeating("Spotify").then(isRepeating => {
console.log(isRepeating); // true || false
});
Is shuffling on or off?
music.isShuffling("Spotify").then(isShuffling => {
console.log(isShuffling); // true || false
});
FAQs
mac osx spotify and itunes music player controller, spotify audio features, itunes and spotify genre, and playlist control
The npm package cody-music receives a total of 36 weekly downloads. As such, cody-music popularity was classified as not popular.
We found that cody-music demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.