
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@supidupiluki/shuffle-array_test
Advanced tools
A small library that takes an array as input and returns a new array that is shuffled.
A small library that takes an array as input and returns a new array that is shuffled.
Install via npm:
npm install @yourusername/shuffle-array
Install via yarn:
yarn add @yourusername/shuffle-array
Basic Usage
import shuffleArray from '@yourusername/shuffle-array';
const startArray = [1, 2, 3, 4, 5];
const newShuffledArray = shuffleArray(startArray);
console.log(startArray); // e.g., [1, 2, 3, 4, 5]
console.log(newShuffledArray); // e.g., [3, 1, 5, 2, 4]
Shuffle a list of user IDs:
import shuffleArray from '@yourusername/shuffle-array';
const userIds = ['u1', 'u2', 'u3', 'u4'];
const randomizedOrderOfUserIds = shuffleArray(userIds);
console.log(randomizedOrderOfUserIds); // e.g., ['u1', 'u3', 'u4', 'u2']
Use in a game for randomizing cards:
import shuffleArray from '@yourusername/shuffle-array';
const deck = ['Ace of Spades', 'Two of Hearts']; // some card deck
const shuffledDeck = shuffleArray(deck);
console.log(shuffledDeck); // e.g., ['Two of Hearts', 'Ace of Spades', ...]
Contributions are welcome! Please see CONTRIBUTING.md for more details.
Please refer to our SECURITY.md for information about our security policies, how to report vulnerabilities, and our approach to handling security concerns.
Important Note: This library uses non-cryptographic randomness (Math.random()). Do not rely on it for security-critical functionality.
This project is licensed under the MIT License.
FAQs
A small library that takes an array as input and returns a new array that is shuffled.
We found that @supidupiluki/shuffle-array_test 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.