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

@trdev20/js-utils

v0.1.13

Published

JavaScript utility functions

Readme

@trdev20/js-utils

A comprehensive TypeScript/JavaScript utility library providing a collection of helper functions for arrays, strings, objects, and numbers.

Installation

pnpm add @trdev20/js-utils
yarn add @trdev20/js-utils
npm install @trdev20/js-utils

Features

  • 🔍 Validators - Type checking and validation utilities
  • 🛠️ Operators - Common operations for arrays, strings, and objects
  • 📊 Getters - Helper functions to retrieve specific data
  • 📦 TypeScript Support - Full type definitions included

Usage

String Utilities

import { upperFirst, toCamelCase, toKebabCase, truncate, slugify } from "@trdev20/js-utils";

upperFirst("hello"); // => 'Hello'
toCamelCase("hello-world"); // => 'helloWorld'
toKebabCase("helloWorld"); // => 'hello-world'
truncate("hello world", 5); // => 'hello...'
slugify("Hello World!"); // => 'hello-world'

Array Utilities

import { uniqueArr, chunkArr, intersection, difference } from "@trdev20/js-utils";

uniqueArr([1, 2, 2, 3]); // => [1, 2, 3]
chunkArr([1, 2, 3, 4, 5], 2); // => [[1, 2], [3, 4], [5]]
intersection([1, 2, 3], [2, 3, 4]); // => [2, 3]
difference([1, 2, 3], [2, 3, 4]); // => [1]

Object Utilities

import { pick, omit } from "@trdev20/js-utils";

pick({ a: 1, b: 2, c: 3 }, ["a", "c"]); // => { a: 1, c: 3 }
omit({ a: 1, b: 2, c: 3 }, ["b"]); // => { a: 1, c: 3 }

Validators

import { isString, isNumber, isArray, isObject, isPrime, isOdd, isEven } from "@trdev20/js-utils";

isString("hello"); // => true
isNumber(123); // => true
isArray([1, 2, 3]); // => true
isObject({}); // => true
isPrime(7); // => true
isOdd(3); // => true
isEven(4); // => true

API Documentation

String Operators

  • upperFirst(str: string): Capitalizes the first letter of a string
  • toCamelCase(str: string): Converts a string to camelCase
  • toKebabCase(str: string): Converts a string to kebab-case
  • toTitleCase(str: string): Converts a string to Title Case
  • truncate(str: string, length: number): Truncates a string to specified length
  • slugify(str: string): Converts a string to URL-friendly format

Array Operators

  • uniqueArr<T>(arr: T[]): Returns array with unique items
  • chunkArr<T>(arr: T[], size: number): Splits array into chunks
  • intersection<T>(arr1: T[], arr2: T[]): Returns common elements
  • difference<T>(arr1: T[], arr2: T[]): Returns elements in arr1 not in arr2

Object Operators

  • pick<T, K extends keyof T>(obj: T, keys: K[]): Creates object with selected properties
  • omit<T, K extends keyof T>(obj: T, keys: K[]): Creates object without specified properties

Validators

  • isString(value: unknown): Checks if value is string
  • isNumber(value: unknown): Checks if value is number
  • isArray(value: unknown): Checks if value is array
  • isObject(value: unknown): Checks if value is object
  • isPrime(value: number): Checks if number is prime
  • isOdd(value: number): Checks if number is odd
  • isEven(value: number): Checks if number is even
  • isEmptyString(value: string): Checks if string is empty
  • isEmptyArray(value: unknown[]): Checks if array is empty
  • isEmptyObject(value: object): Checks if object is empty

License

MIT © [Taib Rabah]