
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
random-subsets
Advanced tools
Create a set of random-ordered subsets.
random-subsets(array[, subsetSize])subsetSize defaults to 2.
Returns an array of subarrays of size subsetSize. The elements of the
subarrays are in random order. If array.length does not divide evenly into
subsetSize the last subarray of the result will have length
array.length % subsetSize.
Preserves the size and order of the input array.
var subsets = require('random-subsets');
subsets([1, 2, 3, 4]);
//=> [[3, 4], [2, 1]]
subsetSizevar subsets = require('random-subsets');
subsets([1, 2, 3, 4], 1);
//=> [[4], [2], [3], [1]]
var subsets = require('random-subsets');
subsets([1, 2, 3, 4], 3);
//=> [[4, 2, 3], [1]]
FAQs
Create a set of random-ordered subsets.
The npm package random-subsets receives a total of 1 weekly downloads. As such, random-subsets popularity was classified as not popular.
We found that random-subsets 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
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.