quickselect is a highly optimized, tiny JavaScript library implementing the Floyd-Rivest selection algorithm. It efficiently partially sorts an array in-place, ensuring that elements up to a specified index `k` are the smallest in the given range. The current stable version is 3.0.0, which was a significant update dropping CommonJS and UMD builds, making it exclusively ESM and requiring modern ES syntax. Releases appear to be infrequent, driven by significant architectural changes or feature additions. Its primary differentiator is its minimal footprint and speed for selection tasks compared to full sorting algorithms, making it ideal for scenarios where only a subset of sorted elements is needed.
npm install quickselectVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use `quickselect` to partially sort an array in-place, ensuring that elements up to a specific index `k` are the smallest in the given range.
Migrate your project to use ES modules or ensure your build configuration transpiles `quickselect` as an ES module. Use `import quickselect from 'quickselect';`.
Ensure your build process (e.g., Babel) includes `quickselect` in transpilation if targeting environments that do not fully support modern JavaScript.
Upgrade to `v2.0.0` or later, which correctly reintroduced the `module` field and resolved previous Webpack compatibility problems.
Switch to ES module import syntax: `import quickselect from 'quickselect';`.
Ensure your runtime environment supports modern JavaScript or configure your build pipeline (e.g., Babel, esbuild) to transpile `quickselect`.
No dependency data recorded yet.