sc-fns

Overview

A lightweight, production-ready, dependency-free TypeScript utility library designed for modern JavaScript and TypeScript environments.


Welcome to sc-fns

sc-fns is a high-performance, zero-dependency utility toolkit written from the ground up in strict TypeScript. It delivers over 60+ battle-tested utility functions organized across 11 clean module namespaces.

bash
pnpm add sc-fns

Why sc-fns?

Modern JavaScript runtimes (Node.js 18+, Bun, Deno, and modern evergreen browsers) now provide native web standards like crypto.randomUUID, Intl, URL, and structuredClone. However, day-to-day application development still requires clean, predictable helper functions for string sanitization, array manipulation, date calculations, object transformations, and input validation.

Most existing utility libraries either:

  1. Carry heavy legacy compatibility shims and complex internal dependency chains.
  2. Force you to pull in hundreds of transitive dependencies.
  3. Lack first-class TypeScript types or proper modern ESM exports.

sc-fns solves this with a zero-dependency, tree-shakeable, and TypeScript-first design.


Core Pillars


Available Modules

ModuleSubpath ImportDescription
Stringsc-fns/stringSlugify, word casing, whitespace normalization, masking, and truncation
ID & Randomsc-fns/idRFC 4122 v4 UUID, short IDs, numeric OTP, and random number generators
Arraysc-fns/arrayChunking, deduplication, Fisher-Yates shuffling, grouping, and flattening
Numbersc-fns/numberClamping, Intl number formatting, rounding to precision, percentages
Objectsc-fns/objectpick, omit, deepClone, deepMerge, and clean undefined/null values
Datesc-fns/dateCustom date formatting, relative time calculation, calendar helpers
Validationsc-fns/validationFast validators for email, URL, UUID, JSON, and runtime type guards
URLsc-fns/urlURL builders, query param serializers, domain, and path extractors
Common & Asyncsc-fns/commondebounce, throttle, retry, sleep, timeout, and once
Filesc-fns/fileFile size formatting (KB/MB/GB), extension extractors, and MIME checks
Browsersc-fns/browserClipboard copy, cookie management, and client-side helpers

Next Steps

How is this guide?

Last updated on October 25, 2026