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

@useless-engineer/utils

v0.1.2

Published

repo for small, utility functions by useless engineer

Readme

🛠️ @useless-engineer/utils

Small, typed utilities distilled from real production bugs. One package. Multiple entry points. Only pay for what you import.

npm version npm downloads license

TypeScript Tree-shakeable Zero deps ESM + CJS React Native

📦 Install · ⚡ Quick start · 📚 API · 🗺️ Roadmap · 📸 Follow


✨ Why this exists

Every utility here started as an Instagram post about a bug that actually shipped. The post explains the problem; this package is the fix, typed and tested, so you never copy-paste it again.

| | | | ------------------------ | ------------------------------------------------------ | | 🎯 Focused | Each function does one thing and has tests | | 🌲 Tree-shakeable | sideEffects: false, import only what you use | | 🧩 Split by platform | Core, React Native, and more, each its own import path | | 🔒 Strictly typed | Written in TypeScript with strict mode on |


📦 Install

npm install @useless-engineer/utils
pnpm add @useless-engineer/utils
yarn add @useless-engineer/utils
bun add @useless-engineer/utils

⚡ Quick start

import { debounce, throttle } from "@useless-engineer/utils";

const onSearch = debounce((query: string) => fetchResults(query), 300);
const onScroll = throttle(() => updateHeader(), 100);
import { isIOS, isAndroid } from "@useless-engineer/utils/react-native";

const padding = isIOS ? 20 : 16;

💡 react and react-native are optional peer dependencies. If you only use the core entry, you never need to install either.


🧭 Entry points

| Import path | For | Status | | -------------------------------------- | ------------------------- | ----------------------------------------------------------------------------- | | @useless-engineer/utils | Platform-agnostic helpers | live | | @useless-engineer/utils/react-native | React Native helpers | live | | @useless-engineer/utils/react | React hooks | soon |


📚 API

Core

Waits for quiet. Every call resets the timer, and only the last call fires. Good for search inputs and autosave.

const save = debounce((text: string) => api.save(text), 500);

save("h");
save("he");
save("hello"); // only this one runs, 500ms after the last call

// In a React effect cleanup, so nothing fires after unmount:
save.cancel();

| Param | Type | Description | | ----------- | ------------------- | ----------------------------------- | | fn | (...args) => void | Function to debounce | | delay | number | Milliseconds of quiet before firing | | returns | Debounced | Callable with a .cancel() method |

Keeps a steady beat. Runs at most once per interval, however often it's called. Good for scroll, drag, and resize.

const onScroll = throttle(() => updateHeader(), 100);

// Skip the immediate first call:
throttle(fn, 100, { leading: false });

// Skip the final catch-up call:
throttle(fn, 100, { trailing: false });

| Option | Default | Description | | ---------- | ------- | --------------------------------------------------- | | leading | true | Fire right away on the first call of a burst | | trailing | true | Fire once more at the end with the latest arguments |

Returns a function with .cancel().

| | debounce | throttle | | ------------ | --------------------------------- | -------------------------------- | | Fires | Once, after calls stop | On a fixed beat during calls | | Use for | Search box, autosave, validation | Scroll, drag, resize | | Ask yourself | "Do I only need the final state?" | "Does it need to stay live?" |

React Native

Plain booleans derived from Platform.OS.

import { isIOS, isAndroid } from "@useless-engineer/utils/react-native";

const behavior = isIOS ? "padding" : "height";

🗺️ Roadmap

Released one or two at a time, each matching a post that's already live.

| Next up | Entry | Origin | | ------------------------------------------------------------------------------------------------------------------------ | ------------ | ------------------------------------ | | nextsafeParseJSON, safeStringify, deepClone | core | JSON and shallow-copy gotchas | | planned getAccessibilityProps, createShadow | react-native | Accessibility and iOS-only shadows | | planned useInterval, useCountdown, useIsMounted | react | Stale closures and unmounted updates |


🤝 Contributing

Found a bug or have a post idea that deserves a utility? Open an issue.

npm install
npm test
npm run build

Built from real bugs, one post at a time.

Instagram

MIT © Saurabh Bandkar