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

my-super-utils

v1.0.0

Published

A powerful, type-safe JavaScript utility library — debounce, throttle, deepClone, formatTime, and more.

Readme

my-super-utils

A powerful, type-safe JavaScript utility library — tiny, zero-dependency, TypeScript-first.

| Build | Bundle | |-------|--------| | ✅ TypeScript strict | 📦 CJS + ESM dual module | | ✅ ESLint | 🏷️ Full .d.ts types |

Install

npm install my-super-utils

Quick start

import { debounce, throttle, deepClone, formatTime, sleep } from 'my-super-utils';

// Debounce — delay invocation until calls stop
const save = debounce((val: string) => fetch('/api/save', { method: 'POST', body: val }), 300);

// Throttle — at most once per 200ms
const onScroll = throttle(() => console.log('scrolled'), 200);

// Deep clone
const copy = deepClone({ a: 1, b: { c: [1, 2, 3] } });

// Time formatting
formatTime(Date.now(), { relative: true });        // "刚刚"
formatTime('2025-06-04', { format: 'YYYY/MM/DD' }); // "2025/06/04"

// Async sleep
await sleep(1000);

API

Control flow

| Function | Signature | Description | |----------|-----------|-------------| | debounce | (fn, wait, opts?) => fn | Return a debounced function. Options: leading, trailing, maxWait. | | throttle | (fn, wait, opts?) => fn | Return a throttled function. Options: leading, trailing. | | sleep | (ms) => Promise<void> | Return a promise that resolves after ms milliseconds. | | once | (fn) => fn | Return a function that executes at most once, then caches the result. | | memoize | (fn, resolver?) => fn | Return a memoized function; cache key is String(args[0]) by default. |

Object

| Function | Signature | Description | |----------|-----------|-------------| | deepClone | <T>(value: T) => T | Deep clone via structuredClone (JSON fallback). | | pick | (obj, keys) => obj | Pick specified keys from an object. | | omit | (obj, keys) => obj | Omit specified keys from an object. | | merge | (target, ...sources) => obj | Deep merge sources into target. Arrays are replaced, not concatenated. |

Collection

| Function | Signature | Description | |----------|-----------|-------------| | range | (startOrEnd, end?, step?) => number[] | Generate a numeric range. range(5)[0,1,2,3,4] | | shuffle | <T>(arr) => T[] | Fisher-Yates shuffle (returns a new array). | | groupBy | <T, K>(arr, fn) => Map<K, T[]> | Group elements by key. | | uniq | <T>(arr) => T[] | Return a new array with deduplicated values. |

Type checking

| Function | Signature | Description | |----------|-----------|-------------| | isNil | (v) => boolean | Check if value is null or undefined. | | isPlainObject | (v) => boolean | Check if value is a plain {} object. | | isEmpty | (v) => boolean | Check for empty: nil, '', [], {}, Set/Map. |

Time

| Function | Signature | Description | |----------|-----------|-------------| | formatTime | (date, opts?) => string | Format date: template (YYYY-MM-DD HH:mm) or relative ("3 小时前"). |

Scripts

| Command | Description | |---------|-------------| | npm run build | Build CJS + ESM bundles with Rollup | | npm run dev | Watch mode rebuild | | npm run typecheck | TypeScript type check (tsc --noEmit) | | npm run lint | ESLint check | | npm run lint:fix | Auto-fix ESLint issues |

License

MIT