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

@frodoy/reusables

v1.0.0

Published

A TypeScript library that holds a couple of reusable utility functions.

Readme

@frodoy/reusables

A lightweight, type-safe utility library for JavaScript and TypeScript, providing clean, reusable helpers for strings, numbers, dates, and data manipulation.


✨ Features

  • 🔒 Fully type-safe (TypeScript-first)
  • ⚡ Lightweight and dependency-free
  • 🧩 Modular utility functions
  • 📚 Auto-documented with JSDoc + TypeDoc
  • 🧠 Designed for real-world production use

📦 Installation

pnpm add @frodoy/reusables

🚀 Usage

import {
  slugify,
  chunkArray,
  addDays,
  clamp,
  percentageFrom,
} from "@frodoy/reusables";

slugify("Hello World!");
chunkArray([1, 2, 3, 4], 2);
addDays(new Date(), 5);
clamp(10, 0, 5);
percentageFrom(20, 200);

📚 API Reference

📝 String Utilities

| Function | Description | | ----------------- | ------------------------------------ | | slugify | Converts string to URL-friendly slug | | truncate | Shortens string with suffix | | toCamelCase | Converts string to camelCase | | capitalizeFirst | Capitalizes first letter | | maskString | Masks sensitive parts of string | | extractEmails | Extracts emails from text |


🔢 Number Utilities

| Function | Description | | ---------------- | --------------------------------- | | clamp | Restricts value within range | | randomInt | Generates random integer | | parseNumber | Safely parses numbers | | percentageFrom | Calculates percentage from total | | percentageOf | Calculates value from percentage | | formatBytes | Converts bytes to readable format | | roundTo | Rounds number precisely |


📅 Date Utilities

| Function | Description | | ------------------ | ---------------------------------- | | getStartOfMonth | Returns first day of month | | isLeapYear | Determines leap year | | isWeekend | Checks if weekend | | addDays | Adds/subtracts days | | timeAgo | Returns relative time string | | daysBetweenDates | Calculates full days between dates |


🛠 Array/Object Utilities

| Function | Description | | ------------ | ------------------------ | | chunkArray | Splits array into chunks | | groupBy | Groups objects by key |


📖 Documentation (Auto-generated)

This project uses JSDoc + TypeDoc.

Generate docs:

pnpm add -D typedoc
npx typedoc --out docs src

Open:

docs/index.html

🔗 Local Development

pnpm build
pnpm link ../reusables

📁 Project Structure

src/
  ├──utils
      ├──utility_functions.ts
      └──utility_types_and_variables.ts
  ├── string_utils.ts
  ├── number_utils.ts
  ├── date_utils.ts
  ├── array_obj_utils.ts
  └── index.ts

📌 Conventions

  • Pure functions only
  • No side effects
  • Strong typing enforced
  • Clean and readable implementations

🚀 Roadmap

  • [ ] More object utilities
  • [ ] Async helpers
  • [ ] Performance benchmarks
  • [ ] Full test coverage

📄 License

MIT


Built by Frodoy