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 🙏

© 2025 – Pkg Stats / Ryan Hefner

utils-sdk-0xfff

v1.0.0

Published

A useful utility library with common helper functions

Readme

utils-sdk-0xfff

A comprehensive utility library with common helper functions for TypeScript/JavaScript projects.

Installation

npm install utils-sdk-0xfff

Features

  • 🎯 TypeScript Support - Full TypeScript definitions included
  • 📦 Tree-shakeable - Only import what you need
  • Zero Dependencies - Lightweight and fast
  • 🔧 Comprehensive - String, Array, Object, and Async utilities

Usage

String Utilities

import { capitalize, toCamelCase, toKebabCase, truncate, isEmail } from 'utils-sdk-0xfff';

capitalize('hello'); // 'Hello'
toCamelCase('hello world'); // 'helloWorld'
toKebabCase('helloWorld'); // 'hello-world'
truncate('This is a long text', 10); // 'This is...'
isEmail('[email protected]'); // true

Array Utilities

import { unique, chunk, shuffle, groupBy, sum, average } from 'utils-sdk-0xfff';

unique([1, 2, 2, 3]); // [1, 2, 3]
chunk([1, 2, 3, 4, 5], 2); // [[1, 2], [3, 4], [5]]
shuffle([1, 2, 3, 4]); // Random order
groupBy([{type: 'a', val: 1}, {type: 'b', val: 2}], item => item.type);
sum([1, 2, 3, 4]); // 10
average([1, 2, 3, 4]); // 2.5

Object Utilities

import { deepClone, pick, omit, deepMerge, isEmpty } from 'utils-sdk-0xfff';

const obj = { a: 1, b: { c: 2 } };
deepClone(obj); // Deep copy
pick(obj, ['a']); // { a: 1 }
omit(obj, ['a']); // { b: { c: 2 } }
deepMerge({ a: 1 }, { b: 2 }); // { a: 1, b: 2 }
isEmpty({}); // true

Async Utilities

import { sleep, retry, parallel, debounce } from 'utils-sdk-0xfff';

await sleep(1000); // Wait 1 second

// Retry with exponential backoff
await retry(async () => {
  // Your async operation
}, { maxRetries: 3, delayMs: 1000, backoff: 2 });

// Run tasks in parallel with concurrency limit
await parallel([task1, task2, task3], 2);

// Debounce function calls
const debouncedFn = debounce(() => console.log('Called'), 300);

API Reference

String Functions

  • capitalize(str: string): string - Capitalizes first letter
  • toCamelCase(str: string): string - Converts to camelCase
  • toKebabCase(str: string): string - Converts to kebab-case
  • truncate(str: string, length: number, suffix?: string): string - Truncates string
  • isEmail(str: string): boolean - Validates email format

Array Functions

  • unique<T>(arr: T[]): T[] - Removes duplicates
  • chunk<T>(arr: T[], size: number): T[][] - Splits into chunks
  • shuffle<T>(arr: T[]): T[] - Randomly shuffles
  • groupBy<T>(arr: T[], keyFn: (item: T) => string | number): Record<string | number, T[]> - Groups by key
  • sum(arr: number[]): number - Sums numbers
  • average(arr: number[]): number - Calculates average

Object Functions

  • deepClone<T>(obj: T): T - Deep clones object
  • pick<T, K>(obj: T, keys: K[]): Pick<T, K> - Picks keys
  • omit<T, K>(obj: T, keys: K[]): Omit<T, K> - Omits keys
  • deepMerge<T>(...objects: Partial<T>[]): T - Deep merges objects
  • isEmpty(obj: object): boolean - Checks if empty

Async Functions

  • sleep(ms: number): Promise<void> - Delays execution
  • retry<T>(fn: () => Promise<T>, options?): Promise<T> - Retries with backoff
  • parallel<T>(tasks: (() => Promise<T>)[], concurrency?: number): Promise<T[]> - Parallel execution
  • debounce<T>(fn: T, delayMs: number): T - Debounces function

Building

npm install
npm run build

Publishing

npm publish --access public

License

MIT