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

dev-utils-plus

v1.1.0

Published

Type-safe utility functions for JavaScript/TypeScript: string, array, object, date, validation, crypto, format, math

Downloads

4

Readme

dev-utils-plus

npm version license: MIT TypeScript

Type-safe utility functions for JavaScript/TypeScript: string, array, object, date, validation, crypto, format, math. Clean APIs, strict types, zero runtime dependencies, and tree-shakable builds.

Features

  • Type-safe utilities: built with TypeScript, .d.ts included
  • Zero dependencies: lightweight and fast
  • Tree-shakable: import only what you need
  • Node + Browser: works across environments
  • Broad coverage: string, array, object, date, validation, crypto, format, math
  • Lodash alternative: modern, modular helper functions
  • Enhanced error handling: comprehensive input validation with descriptive error messages
  • Improved performance: optimized algorithms and better memory usage
  • Rich documentation: detailed JSDoc comments with examples for every function

Install

npm i dev-utils-plus
# or
pnpm add dev-utils-plus
# or
yarn add dev-utils-plus

Quick start

import { 
  // string
  capitalize, 
  toCamelCase,
  toKebabCase,
  toSnakeCase,
  toPascalCase,
  escapeHtml,
  cleanWhitespace,
  generateRandomString,

  // array
  unique, 
  shuffle,
  chunk,
  flatten as flattenArray,
  take,
  drop,
  max,
  min,

  // object
  deepClone, 
  deepMerge,
  pick,
  omit,
  get,
  set,
  flattenObject,

  // date
  formatDate,
  startOfDay,
  endOfDay,
  addDays,

  // format
  formatCurrency,
  formatFileSize,
  formatDuration,

  // math
  clamp,
  median,
  distance,
  binomial,
  randomInt,

  // validation
  isValidEmail,

  // crypto
  generateUUID,
  toBase64,
  fromBase64
} from 'dev-utils-plus';

// Enhanced string utilities
capitalize('hello world'); // "Hello world"
toCamelCase('hello-world'); // "helloWorld"
toPascalCase('hello-world'); // "HelloWorld"
escapeHtml('<div>Hello & world</div>'); // "&lt;div&gt;Hello &amp; world&lt;/div&gt;"
cleanWhitespace('  hello   world  '); // "hello world"

// Enhanced array utilities
unique([1, 2, 2, 3]); // [1, 2, 3]
take([1, 2, 3, 4, 5], 3); // [1, 2, 3]
drop([1, 2, 3, 4, 5], 2); // [3, 4, 5]
max([1, 5, 3, 9, 2]); // 9

// Enhanced math utilities
clamp(10, 0, 5); // 5
median([1, 2, 3, 4]); // 2.5
distance(0, 0, 3, 4); // 5
binomial(5, 2); // 10
randomInt(1, 10); // Random integer between 1-10

// Existing utilities work the same
formatCurrency(1234.56, 'USD'); // "$1,234.56"
isValidEmail('[email protected]'); // true

Modules & APIs

  • String (src/string)

    • Case conversion: capitalize, toCamelCase, toKebabCase, toSnakeCase, toPascalCase, toTitleCase
    • Text manipulation: truncate, stripHtml, wordCount, reverse, isPalindrome
    • Utility: generateRandomString, cleanWhitespace, escapeHtml, unescapeHtml
    • Validation: isAlpha, isAlphanumeric
    • Formatting: padString
    • Note: email validation is in the Validation module (isValidEmail).
  • Array (src/array)

    • Core utilities: unique, shuffle, groupBy, chunk, flatten (with depth control)
    • Set operations: intersection, difference
    • Sorting & filtering: sortBy, compact
    • Access & manipulation: first, last, take, drop
    • Analysis: countBy, max, min
    • Generation: range
  • Object (src/object)

    • deepClone, deepMerge, pick, omit, get, set
    • flattenObject, invert, fromEntries, entries, mapValues
  • Date (src/date)

    • formatDate, startOfDay, endOfDay, addDays, subtractDays
    • daysDifference, isToday, isPast, isFuture, getAge, getWeekNumber, isLeapYear, getDaysInMonth, parseDate, getRelativeTime
  • Format (src/format)

    • formatNumber, formatCurrency, formatPercentage, formatFileSize
    • formatDuration, formatPhoneNumber, formatCreditCard, formatSSN
    • formatPostalCode, formatName, formatSentence, formatTitle, formatSlug, formatOrdinal
  • Math (src/math)

    • Basic operations: clamp, lerp, mapRange, isBetween, roundTo, percentage
    • Advanced math: factorial, gcd, lcm, nthRoot, binomial
    • Number theory: isPrime, generatePrimes
    • Statistics: sum, average, median, mode, standardDeviation, variance
    • Random generation: randomInt, randomFloat
    • Geometry: distance, degreesToRadians, radiansToDegrees
  • Validation (src/validation)

    • isValidEmail, isValidUrl, isValidPhoneNumber, isValidCreditCard
    • isValidPassword, isValidIPv4, isValidIPv6, isValidPostalCode, isValidSSN
    • isValidDate, isValidTime, isValidHexColor, isValidJSON, isValidUUID
    • validateSchema<T>(obj, schema)
  • Crypto (src/crypto)

    • randomString, randomNumber, generateUUID
    • toBase64, fromBase64, toBase64Url, fromBase64Url
    • simpleHash, checksum, randomHex, randomAlphanumeric, randomNumeric
    • generatePassword({ length, includeUppercase, includeLowercase, includeNumbers, includeSymbols })

TypeScript

  • Strict types by default; .d.ts generated on build.
  • Tree-shakable with modern bundlers; import only what you need.

Scripts

  • npm run dev: tsc --watch
  • npm run build: compile to dist
  • npm test: run Jest
  • npm run lint: ESLint on src/**/*.ts

CI / Release

  • CI: lint, test, build on push/PR (.github/workflows/ci.yml).
  • Release: publish to npm and create GitHub Release on tags v*.*.* (.github/workflows/release.yml).
    • Set NPM_TOKEN in repo Settings → Secrets and variables → Actions.

License

MIT