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

unich-ts-utils

v0.2.1

Published

Utility functions for JavaScript/TypeScript projects

Readme

unich-ts-utils

Version License TypeScript Test Coverage

A comprehensive utility library for TypeScript/JavaScript projects, providing a collection of well-tested, type-safe utility functions organized by category to simplify your development workflow.

🚀 Quick Start

# npm
npm install unich-ts-utils

# yarn
yarn add unich-ts-utils

# pnpm
pnpm add unich-ts-utils
// Import only what you need
import { formatCurrency, toPercentString } from 'unich-ts-utils';

// Format currency with options
formatCurrency(1234.567, { symbol: '$' }); // "$1,234.57"

// Format percentage
toPercentString(0.1234, { showPlusSign: true }); // "+12.34%"

✨ Features

  • 🎯 Type-safe - Full TypeScript support with proper type definitions
  • 📦 Tree-shakeable - Import only what you need for optimal bundle size
  • 🔄 Dual package - Supports both CommonJS and ESM
  • 📝 Well-documented - Comprehensive documentation and examples
  • Tested - Thoroughly tested with Jest
  • 🧩 Modular - Organized by category for easy discovery and use

📚 Documentation

Interactive Documentation

The package includes comprehensive interactive documentation:

# Generate and open documentation in browser
npm run docs && npm run docs:open

# Open API documentation directly
npm run docs:api

# Generate markdown documentation
npm run docs:markdown

Documentation Guide

For a complete guide on how to navigate and use the documentation, see the DOCUMENTATION.md file.

🧰 Available Modules

📝 String Utilities

String manipulation functions for common text operations.

import { capitalize, truncate, toKebabCase } from 'unich-ts-utils';

capitalize('hello world'); // => "Hello world"
truncate('This is a long text', 10); // => "This is a..."
toKebabCase('helloWorld'); // => "hello-world"

🔢 Array Utilities

Functions for array operations and transformations.

import { unique, groupBy, chunk } from 'unich-ts-utils';

unique([1, 2, 2, 3, 3, 4]); // => [1, 2, 3, 4]
chunk([1, 2, 3, 4, 5], 2); // => [[1, 2], [3, 4], [5]]

💱 Numberish Utilities

Advanced utilities for formatting, parsing, and manipulating numbers.

import { formatCurrency, toPercentString, toApr } from 'unich-ts-utils';

formatCurrency(1234.567, { symbol: '$' }); // => "$1,234.57"
formatCurrency(1234567.89, { abbreviated: true }); // => "1.23M"

toPercentString(0.1234); // => "12.34%"
toPercentString(0.1234, { showPlusSign: true }); // => "+12.34%"

toApr(0.0567); // => "5.67%"

🧩 Object Utilities

Functions for object manipulation and transformation.

import { deepClone, pick, omit } from 'unich-ts-utils';

const obj = { a: 1, b: { c: 2 } };
const clone = deepClone(obj);

pick({ id: 1, name: 'John', age: 30 }, ['name', 'age']); // => { name: 'John', age: 30 }
omit({ id: 1, name: 'John', age: 30 }, ['age']); // => { id: 1, name: 'John' }

📅 Date Utilities

Functions for date formatting and manipulation.

import { formatDate, addDays } from 'unich-ts-utils';

const date = new Date('2024-03-05');
formatDate(date, 'YYYY-MM-DD'); // => "2024-03-05"
addDays(date, 1); // => Date object for March 6, 2024

⚛️ React Utilities

Components and hooks for React applications.

import { mergeRef, pickChild } from 'unich-ts-utils';

// Merge multiple refs
const Component = React.forwardRef((props, ref) => {
  const localRef = useRef(null);
  const mergedRef = mergeRef(ref, localRef);
  
  return <div ref={mergedRef} />;
});

// Pick child components by type
const header = pickChild(children, Header);

🛠️ Development

Getting Started

# Clone the repository
git clone https://github.com/twan-unich/utils.git

# Install dependencies
npm install

# Run tests
npm test

# Build
npm run build

Documentation Development

# Generate documentation
npm run docs

# Open documentation in browser
npm run docs:open

# Generate changelog
npm run changelog

📄 License

MIT

👤 Author

Twan Unich