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

@explita/utils

v0.3.0

Published

A lightweight and versatile collection of TypeScript utility functions designed for everyday development needs. Streamline your Node.js, React, and Next.js projects with a powerful set of well-organized helpers for strings, arrays, dates, objects, and mor

Readme

@explita/utils

A lightweight, high-performance collection of TypeScript utility functions and React hooks designed for everyday development.

npm version TypeScript License: MIT

Explore Full Documentation & Examples →


📦 Installation

# npm
npm install @explita/utils

# pnpm
pnpm add @explita/utils

# yarn
yarn add @explita/utils

⚡ Quick Start

import {
  formatDate,
  formatRelative,
  timeAgo,
  keyBy,
  sortBy,
  clamp,
  formatCurrency,
  truncate,
  deepMerge,
  get,
  tryCatch,
} from "@explita/utils";

// 📅 Date Helpers
formatDate(new Date(), "YYYY-MM-DD"); // "2026-08-31"
timeAgo(Date.now() - 5 * 60 * 1000);   // "5 minutes ago"

// 🗂️ Array Helpers
keyBy([{ id: "u_1", name: "Alice" }], "id"); // { "u_1": { id: "u_1", name: "Alice" } }
sortBy([{ price: 20 }, { price: 10 }], "price"); // [{ price: 10 }, { price: 20 }]

// 🔢 Numbers & Strings
clamp(105, 0, 100);                    // 100
formatCurrency(1234.56, "$");          // "$1,234.56"
truncate("The quick brown fox jumps", 15); // "The quick..."

// 📦 Objects & Async
get({ user: { name: "Sarah" } }, "user.name"); // "Sarah"
const [data, error] = await tryCatch(fetchUser());

🎣 React Hooks

Import from @explita/utils/react:

import {
  useLocalStorage,
  useList,
  useClipboard,
  useOnClickOutside,
  useMediaQuery,
  useDisclosure,
} from "@explita/utils/react";

function ProfileWidget() {
  const [theme, setTheme] = useLocalStorage("theme", "dark");
  const { copy, copied } = useClipboard(2000);
  const [isOpen, { toggle, close }] = useDisclosure(false);
  const isMobile = useMediaQuery("(max-width: 768px)");

  return (
    <div>
      <button onClick={() => copy("api_key_123")}>
        {copied ? "Copied!" : "Copy API Key"}
      </button>
    </div>
  );
}

📚 Entry Points & Modules

| Entry Point | Description | Key Helpers | | :--- | :--- | :--- | | @explita/utils | Core utilities for dates, arrays, strings, objects, numbers, and async | formatDate, timeAgo, keyBy, sortBy, clamp, get, deepMerge, tryCatch, timeout, memoize | | @explita/utils/react | React hooks with SSR safety | useLocalStorage, useList, useClipboard, useOnClickOutside, useMediaQuery, useIntersectionObserver, usePrevious, useIsMounted | | @explita/utils/axios | Normalized Axios error handling | tryAxios (typed schemas with kind, meta, original) | | @explita/utils/zod | Zod schema & form helpers | validateForm, mapZodIssues, createDefaultValues, isZodIssue | | @explita/utils/file | Browser file exporters | saveCSVToFile, saveJSONToFile, saveXMLToFile |


📖 Detailed Documentation

For comprehensive API signatures, interactive examples, and guides, visit the documentation site:


💖 Support & Community

  • Star on GitHub: Give us a ⭐ on GitHub to help others discover the project.
  • Report Issues: Found a bug or need a helper? Open an issue or start a discussion.
  • Sponsor: Support continued development via GitHub Sponsors or Ko-fi.

📄 License

MIT © Explita