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

@andrmhndr/cleankit

v0.0.40

Published

A lightweight React utility kit for those who want to be clean.

Readme

🧼 @andrmhndr/cleankit

A beautifully structured utility kit for React & Next.js projects. Includes global dialogs, query param management, debouncing, date formatting, and object/list cleaning helpers.

Made for developers who care about clean code, efficiency, and a little bit of magic ✨


📦 Installation

npm install @andrmhndr/cleankit
# or
yarn add @andrmhndr/cleankit

📚 Features

  • 🧠 DialogProvider — Promise-based global modals.
  • 🔍 useQueryParams — Easy query param management.
  • 🕒 debounce — Lightweight function throttling.
  • 📅 formatDate — Date formatting with locale support.
  • 🧹 cleanObject & cleanList — Remove noise from objects and arrays.

🔘 DialogProvider

Setup

import { DialogProvider } from "@andrmhndr/cleankit";

export default function App({ Component, pageProps }) {
  return (
    <DialogProvider>
      <Component {...pageProps} />
    </DialogProvider>
  );
}

Usage

import { useContext } from "react";
import { DialogContext } from "@andrmhndr/cleankit";

const MyComponent = () => {
  const dialog = useContext(DialogContext);

  const handleClick = async () => {
    const result = await dialog?.openDialog({
      content: (close) => (
        <div>
          <p>Are you sure?</p>
          <button onClick={() => close(true)}>Yes</button>
          <button onClick={() => close(false)}>No</button>
        </div>
      ),
    });

    console.log("Dialog result:", result);
  };

  return <button onClick={handleClick}>Show Dialog</button>;
};

🔗 useQueryParams

Manage URL query params with ease (works with Next.js and React Router).

import { useQueryParams } from "@andrmhndr/cleankit/react";

const { getOne, setQuery, removeQuery, clearQuery } = useQueryParams();

getOne("search");
setQuery({ search: "Next.js" });
removeQuery("search");
clearQuery();

// With debounce
setQuery({ search: "react" }, { debounce: 300 });

⚠️ For Next.js, make sure your useQueryParams imports from @andrmhndr/cleankit/next instead of base package.


🕒 debounce

import { debounce } from "@andrmhndr/cleankit";

const log = debounce((val: string) => console.log(val), 500);

log("Hello world");

📅 formatDate

import { formatDate } from "@andrmhndr/cleankit/server";


dateFormatter("2023-12-25T14:30:00", { format: "dd MMMM yyyy HH:mm" })
dateFormatter(new Date(), {
  format: "EEEE, d MMM yyyy hh:mm a",
  dayNamesFull: ["Minggu", "Senin", ...],
  monthNames: ["Januari", "Februari", ...],
  amPmLabels: ["pagi", "malam"]
})

🧹 cleanObject & cleanList

Clean out unwanted values from data objects and arrays.

🧼 cleanObject

Removes null, undefined, and empty string "" values from an object.

import { cleanObject } from "@andrmhndr/cleankit/server";

const cleaned = cleanObject({
  name: "Felicia",
  age: null,
  email: "",
  location: undefined,
});
// => { name: "Felicia" }

🧼 cleanList

Removes null, undefined, empty strings "", and empty arrays []. Optionally inserts a spacer between items.

import { cleanList } from "@andrmhndr/cleankit/server";

const cleaned = cleanList([null, "React", "", [], "Next.js", undefined]);
// => ["React", "Next.js"]

const spaced = cleanList(["A", "B", "C"], (i) => <hr key={i} />);
// => ["A", <hr />, "B", <hr />, "C"]

📖 License

MIT — Use it, love it, and make something beautiful.
And remember... Keep pushin' your self up!