A lightweight collection of TypeScript utility functions for everyday development.
- π§ String utilities β slugify, truncate, capitalize, camelCase
- π Date helpers β relative time, format, timezone-aware parsing
- π’ Number utils β clamp, round to precision, currency formatting
- π― Type guards β runtime type checking with TypeScript inference
- β‘ Zero dependencies β tree-shakeable ESM
npm install @lawrencekwan/ts-utilsimport { slugify, relativeTime, clamp, isNonNullable } from '@lawrencekwan/ts-utils';
slugify('Hello World!'); // 'hello-world'
relativeTime(new Date('2024-01-01')); // '1 year ago'
clamp(150, 0, 100); // 100
isNonNullable(value); // type narrows to NonNullable<T>MIT