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

@itzyourbread/utils

v1.0.1

Published

All-in-one utility library for Node.js & browser with TypeScript support

Downloads

179

Readme

🚀 @itzyourbread/utils

All-in-one utility library for Node.js & browser with full TypeScript support

A clean, modular, and production-ready collection of reusable utility functions for strings, arrays, objects, dates, files, networking, and more.


✨ Features

  • 🔤 String Utilitiescapitalize, truncate, cleanString, slugify, randomString
  • 📦 Array / Object UtilitiesuniqueBy, chunk, shuffle, flatten, pickRandom
  • ⏱️ Date / Time UtilitiesformatDate, convertTZ, timer
  • 📁 File / Path UtilitiesformatBytes, exists, readJSON, writeJSON, normalizePath
  • 🌐 Network UtilitiesretryFetch, buildQuery, rateLimit
  • ⚙️ Misc UtilitiesenvInfo, debounce, throttle, generateUUID

📦 Installation

# npm
npm install @itzyourbread/utils

# yarn
yarn add @itzyourbread/utils

🧠 Usage

Import Entire Library

const utils = require("@itzyourbread/utils");

console.log(utils.capitalize("hello world"));
// → Hello world

Import Specific Functions

const { capitalize, slugify, chunk } = require("@itzyourbread/utils");

console.log(capitalize("hello"));
// → Hello

console.log(slugify("Hello World", "camel"));
// → helloWorld

console.log(chunk([1,2,3,4,5], 2));
// → [[1,2],[3,4],[5]]

TypeScript

import { capitalize, chunk, flatten } from "@itzyourbread/utils";

const text: string = capitalize("hello world");
const chunks: number[][] = chunk([1,2,3,4], 2);
const flat: number[] = flatten([1,[2,3],[4,[5]]]);

🔤 String Utilities

capitalize("hello")
// → "Hello"

truncate("This is long", 7)
// → "This is …"

cleanString("  Hello! @World# ")
// → "Hello World"

slugify("Hello World", "snake")
// → "hello_world"

randomString(8)
// → "A1b2C3d4"

📦 Array / Object Utilities

uniqueBy([{id:1},{id:2},{id:1}], "id")
// → [{id:1},{id:2}]

chunk([1,2,3,4,5], 2)
// → [[1,2],[3,4],[5]]

shuffle([1,2,3,4])
// → [random order]

flatten([1,[2,3],[4,[5]]])
// → [1,2,3,4,5]

pickRandom([10,20,30])
// → 20 (random)

⏱️ Date / Time Utilities

formatDate(new Date())
// → 2026-03-18T12:27:38.078Z

formatDate(new Date(), true)
// → "0 seconds ago"

convertTZ(new Date(), "Asia/Dhaka")
// → Date object

timer(() => { /* code */ })
// → { result, ms }

📁 File / Path Utilities

formatBytes(10240)
// → "10.00 KB"

exists("./file.json")
// → true / false

readJSON("./file.json")
// → { ... }

writeJSON("./file.json", { hello: "world" })

normalizePath("folder\\file.txt")
// → "folder/file.txt"

🌐 Network Utilities

await retryFetch("https://jsonplaceholder.typicode.com/todos/1");

buildQuery({ a: 1, b: "hello" })
// → "a=1&b=hello"

const limited = rateLimit(fn, 500);

⚙️ Miscellaneous Utilities

envInfo()
// → { node, env, os }

debounce(fn, 300);
throttle(fn, 500);

generateUUID()
// → "b3889f88-decb-4791-ae77-cce83743eff0"

📌 Notes

  • Works in both Node.js and browser environments
  • Supports tree-shaking via modular imports
  • Lightweight and optimized for production use
  • Fully typed with TypeScript

📄 License

MIT © Arif Satify