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

unnecessary-ai

v0.0.1

Published

Unnecessary-AI: Sort anything by any absurd, hilarious, or ridiculously specific criterion

Readme

🌀 Unnecessary-AI

AI-powered sorting of anything by ridiculously specific and absurd criteria. Inspired by VibeSort for creative sorting logic.

Install

npm i unnecessary-ai

Usage

import { z } from "zod";
import { overengineer } from "unnecessary-ai";

const responseFormat = z.object({
  sorted: z.array(z.object({
    name: z.string(),
    calories: z.number(),
    timesEaten: z.number(),
    organic: z.boolean(),
    rating: z.number().min(0).max(5),
    price: z.number(),
    tags: z.array(z.string()),
    nutrition: z.object({ carbs: z.number(), protein: z.number(), fat: z.number() }),
    lastEaten: z.string()
  }))
});

type TFormat = z.infer<typeof responseFormat>;

const target = [
  { name: "Avocado Toast", calories: 320, timesEaten: 42, organic: true, rating: 4.1, price: 6.5, tags: ["vegan", "breakfast"], nutrition: { carbs: 28, protein: 6, fat: 18 }, lastEaten: "2025-08-10T12:00:00.000Z" },
  { name: "Double Bacon Burger", calories: 980, timesEaten: 8, organic: false, rating: 4.8, price: 11.0, tags: ["meat", "fast-food"], nutrition: { carbs: 48, protein: 52, fat: 62 }, lastEaten: "2025-08-18T20:30:00.000Z" },
  { name: "Quinoa Salad Deluxe", calories: 420, timesEaten: 28, organic: true, rating: 4.5, price: 9.0, tags: ["vegan", "salad", "gluten-free"], nutrition: { carbs: 40, protein: 12, fat: 14 }, lastEaten: "2025-07-21T13:00:00.000Z" },
  // more items...
];

const res = await overengineer<TFormat>({
  target: target,
  criteria: `
    Sort in descending order from the most outrageously appealing to the least:
    1. Multiply calories by times eaten (more = higher priority).
    2. Slightly adjust scores for organic foods (variety is fun!).
    3. Reverse the rating (5 stars = least surprising, 0 = most surprising).
    4. Boost items tagged "spicy" or "dessert".
    5. Prioritize foods that haven’t been eaten in the longest time.
    6. Divide price by protein content for extra chaos.
    7. Mix all factors in a completely chaotic way.
  `,
  response_format: responseFormat
});

if (res) {
  console.log(res.sorted);
}

| Parameter | Type | Required | Description | | ----------------- | ------------ | -------- | ------------------------------------------------------------------------------------ | | target | any[] | ✅ | Array of items to sort (objects, numbers, anything). | | criteria | string | ✅ | Natural-language sorting rules, can be as complex or absurd as you like. | | api_key | string | ❌ | Optional. If not provided, the function reads OPENAI_API_KEY environment variable. | | model | TModel | ❌ | Optional AI model to use (e.g., "gpt-4.1"). | | response_format | ZodTypeAny | ✅ | Zod schema describing the structure of the expected sorted output. |