Explita Utils (@explita/utils) is a modern, carefully curated utility library designed to replace bloated monolithic dependencies like Lodash or date-fns with a clean, tree-shakeable toolkit for Node.js, React, and Next.js applications. Built with end-to-end TypeScript safety from the ground up, the library is architected around specialized subpath exports: core data utilities (@explita/utils), SSR-friendly custom React hooks (@explita/utils/react), form validation helpers (@explita/utils/zod), normalized HTTP request wrappers (@explita/utils/axios), and browser file exporters (@explita/utils/file).
The core package delivers high-performance, non-mutating primitives for everyday data transformations. String utilities provide comprehensive case conversions (toCamelCase, toKebabCase, toSnakeCase, toTitleCase, toSentenceCase), slugification (slugify), currency formatting (formatCurrency), file size conversions (convertFileSize), masking (mask), and URL query string serialization (buildQueryString, parseQueryString). Object utilities handle recursive, non-mutating merging (deepMerge), dot-notation retrieval (get), object compaction (compactObject), key prefixing (prependKeys), and two-way flattening (flattenObject, unflattenObject). Array and numeric helpers simplify complex data pipelines with lookup indexing (keyBy), grouping (groupBy), multi-field sorting (sortBy), partitioning (partition), set algebra (intersection, difference, uniqueByKey, findDuplicates), chunking (chunk), array shuffling (shuffleArray), and numeric clamping (clamp).
For date and time management, Explita Utils provides zero-dependency date formatting with customizable token patterns (formatDate, formatTime, formatDateTime), relative humanization (timeAgo, timeUntil, formatRelative), calendar boundary calculations (startOfDay, endOfDay), and interval comparisons (isWithinInterval, minDate, maxDate). For asynchronous workflows, it equips developers with Go-style error handling tuples via tryCatch (removing nested try/catch boilerplate), promise deadlines via timeout, debouncing (debounce), throttling (throttle), exponential backoff retries (retry), and function result memoization (memoize).
The @explita/utils/react entrypoint ships a robust collection of lightweight, SSR-friendly custom hooks: useLocalStorage with automatic JSON serialization and cross-tab synchronization, useList for reactive array state operations (append, prepend, remove, reorder), useDebouncedValue for responsive search inputs, useDisclosure for modal/drawer toggles, useClipboard for one-click copy feedback, and DOM observers such as useMediaQuery, useIntersectionObserver, useOnClickOutside, useWindowSize, useWindowScroll, and useNetwork. On the integration front, @explita/utils/axios provides tryAxios to normalize network and logic errors with categorized metadata, @explita/utils/zod streamlines form state bootstrapping with createDefaultValues, validateForm, and mapZodIssues, while @explita/utils/file triggers direct browser-side downloads for CSV, JSON, and XML files (saveCSVToFile, saveJSONToFile, saveXMLToFile).