
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
playback-queue
Advanced tools
A node module for creating and operating on a playback queue. Includes history, shuffling, and repetition.
A node module for creating and operating on a music playback queue. Includes history, shuffling, and repeating.
npm install --save playback-queue
import PlaybackQueue from 'playback-queue'
const options = {};
const queue = new PlaybackQueue(options);
tracks: An array of tracks (or any other object you want in the queue). These will be the objects processed and returned by the queue.
array[]shuffle: A flag indicating whether or not playback (and returned tracks) should be randomly shuffled.
booleanfalserepeat: A string indicating how playback should be repeated.
string['playlist', 'track', 'none']'playlist'PlaybackQueue, once instantiated, exposes a handful of methods with which to operate on the queue and retrieve objects. Any methods not intended for outside use are prefixed with an underscore (_).
setTracks(tracks)Manually sets the playlist of tracks in the queue, then resets all states (except shuffle and repeat) and selects the first track.
nextTrack()Selects and returns the next track to be played, based on current repeat and shuffle states. Updates state and queues accordingly.
previousTrack()Selects and returns the previous track played based on play history. Returns previous song in current playlist if no history. Updates state and queues accordingly.
selectTrack(track)Manually selects the given track, updating state and queues accordingly. Note: Throws an error if provided track is not in current playlist.
toggleShuffle()Toggles the shuffle state between shuffled and not shuffled.
toggleRepeat()Toggles the shuffle state between 'playlist', 'track', and 'none'.
sortTracks(attr, asc)Sorts the current playlist by the provided attribute (key). Also takes an asc parameter, specifying whether the sort should be ascending or not. Defaults to true.
queuePoolcurrentTrackcurrentIndexisShuffledrepeatStateshufflePoolshuffleIndexplayHistoryhistoryIndexgit clone https://github.com/jakemmarsh/playback-queue.gitcd playback-queuenpm installnpm test (or npm run test-watch to continuously run on file change)FAQs
A node module for creating and operating on a playback queue. Includes history, shuffling, and repetition.
The npm package playback-queue receives a total of 1 weekly downloads. As such, playback-queue popularity was classified as not popular.
We found that playback-queue 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.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.