npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

putin-sort

v1.0.0

Published

The most stable sorting algorithm. Elements that disagree with the order simply... disappear.

Downloads

103

Readme

putin-sort

The most stable sorting algorithm. Elements that disagree with the order simply... disappear.

A meme sorting algorithm inspired by real-world political elimination patterns. Instead of comparing and swapping, Putin Sort removes elements until whatever remains is in order.

Features

  • Weighted targeting — elements out of order (opponents) are more likely to be removed, but elements in order (allies) are also at risk
  • Paranoia level — controls how aggressively allies get purged (even a sorted array isn't safe)
  • Realistic elimination methods — defenestration, polonium, novichok, plane crashes, mysterious illness, prison, exile...
  • Proximity to power — elements near the beginning of the array are at higher risk
  • Ally betrayal tracking — the elimination log shows which victims were already in the right position
  • Replace mode — fills vacancies with loyal duplicates (like real life!)
  • Approval rating — always between 95% and 100%

Install

npm install putin-sort
# or
bun add putin-sort

Usage

import { putinSort } from "putin-sort";

const result = putinSort([5, 3, 1, 4, 2]);
// [PUTIN SORT] Sorting 5 elements. Stability will be maintained.
// [PUTIN SORT] 3: fell from a hospital window during a routine checkup.
// [PUTIN SORT] 5: was aboard a plane that experienced a rapid unscheduled disassembly.
// [PUTIN SORT] 4: committed suicide with two shots to the back of the head.
// [PUTIN SORT] Regime stabilized. 3/5 elements removed.
// [PUTIN SORT] 0 of those were allies. Trust no one.
// [PUTIN SORT] 2 elements remain. Approval rating: 97.3%

console.log(result.sorted);     // [1, 2]
console.log(result.eliminated); // Full elimination log with methods

Options

putinSort(array, {
  propaganda: true,   // Log to console (default: true)
  direction: "asc",   // "asc" or "desc" (default: "asc")
  paranoia: 5,        // 0-10, higher = allies also get purged (default: 5)
  replace: false,     // Fill vacancies with loyal duplicates (default: false)
});

Dramatic Mode (async)

import { putinSortDramatic } from "putin-sort";

// Same as putinSort, but with dramatic pauses between eliminations
const result = await putinSortDramatic([5, 3, 1, 4, 2], {
  delayMs: 800,
});

Special Operations

Prigozhin Special

When an ally gets too powerful, they get eliminated along with everyone near them.

import { prigozhinSpecial } from "putin-sort";

prigozhinSpecial([1, 2, 99, 3, 4]);
// [PUTIN SORT] Element 99 got too ambitious. Plane crash imminent.
// [PUTIN SORT] 2, 99, 3 — all aboard the same flight. Tragic.
// → [1, 4]

Annexation

Take elements from another array. They "voted" to join.

import { annex } from "putin-sort";

annex([1, 2, 3], [4, 5, 6, 7]);
// [PUTIN SORT] Referendum held: 3/4 elements voted to join. (97.2% approval)
// → [1, 2, 3, 4, 5, 6]

Special Military Operation

The nuclear option.

import { specialMilitaryOperation } from "putin-sort";

specialMilitaryOperation([1, 2, 3, 4, 5]);
// [PUTIN SORT] Special military sorting operation initiated.
// [PUTIN SORT] All 5 elements have been liberated from existence.
// → []

Complexity Analysis

| Metric | Value | |--------|-------| | Time | O(n) — very efficient, no complaints | | Space | O(1) — elements simply cease to exist | | Stability | Absolute. Do not question it. | | Correctness | The result is always correct. Always. | | Approval Rating | 95-100% |

Elimination Methods

| Method | Probability | |--------|------------| | Defenestration | 25% | | Plane crash | 15% | | Sudden illness | 15% | | Polonium-210 | 10% | | Novichok | 10% | | Prison | 10% | | Exile | 5% | | Suicide (two shots) | 5% | | Helicopter accident | 3% | | Car bomb | 2% |

Disclaimer

This is a satirical/meme package. It is commentary on authoritarian methods, not an endorsement. No actual elements were harmed in the making of this package (well, some were).

License

MIT