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

@andrewtaylor/util-ai

v1.0.2

Published

Are you tired of packages like [lodash](https://lodash.com/) and all their missing functions? Are you sick of having to import dozens of helper libraries to get everything you need? Are you done with having to remember whether a particular function is cal

Downloads

20

Readme

util-ai

Are you tired of packages like lodash and all their missing functions? Are you sick of having to import dozens of helper libraries to get everything you need? Are you done with having to remember whether a particular function is called includes or contains? util-ai is a new package based on the pioneering work of the team at is-even-ai that uses the power of AI to do anything, and of Javascript to let you do anything, to make one package that contains literally every function imaginable (as long as the input and output of that function can be serialised into text for ChatGPT).

Try the example code:

const AiUtil = require("util-ai");
const aiUtil = AiUtil({ apiKey: "YOUR_OPENAI_API_KEY" });

console.log("7 is prime?",
    await aiUtil.isPrime(7));

console.log("Lowest common multiple of 7, 12 and 5",
    await aiUtil.lowestCommonMultiple(7, 12, 5));

console.log("9 is one below a number divisible by three?",
    await aiUtil.isOneBelowANumberDivisibleByThree(9));

console.log("CRAWL is allowed in Wordle?",
    await aiUtil.isAllowedInWordle("CRAWL"));

How does this work?

It probably doesn't, AI is garbage! You'll get wrong answers, more slowly than with real code, and at huge expense both to yourself and the planet! In any case I haven't tested this code because I don't have an OpenAI API key, and refuse to pay for one.

How is this supposed to work?

In Javascript, Obj.methodName is the same as Obj["methodName"], using the regular string indexer. Also, Javascript allows you to make a "proxy" object, which can run any behaviour you like when the string indexer is called. So if we define an object like this:

const aiUtil = new Proxy({}, {
    get(target, name, receiver) {
        return name + " AI";
    }
});

then we can index it however we want and that code will run.

console.log(aiUtil["test"]); // -> "test AI"
console.log(aiUtil.secondTest); // -> "secondTest AI"

If we return a function, we can run that function like a normal method:

const aiUtil = new Proxy({}, {
    get(target, name, receiver) {
        return () => name + " AI";
    }
});

const value = aiUtil.test();

console.log(value); // -> "test AI"

Now all we need to do is have the returned function call ChatGPT, and we can effectively use any function we want!

const aiUtil = new Proxy({}, {
    get(target, name, receiver) {
        return async (...args) => {
            const response = await callChatGpt(
                `Toolbox is a helpful Javascript utility library,
                which contains many useful functions.
                What value would you expect the code
                Toolbox.${name}(${args.map(JSON.stringify).join(", ")})
                to return?
                
                Answer in valid JSON, do not return anything that is not valid JSON.
                Assume the function ${name} exists, is being used correctly,
                and does not throw an error.`
            );
            return JSON.parse(response);
        };
    }
});

const value = await aiUtil.isPrime(7);

console.log(value); // true