Shared Utils Overview
@caffeinebounce/shared-utils is the low-level utility layer that keeps shared packages and app repos consistent around formatting, URL validation, auth helpers, and request metadata.
Install
yarn add @caffeinebounce/shared-utilsBest-fit use cases
- Shared formatters for currency, percentages, dates, and phone numbers
- URL and social-handle validation schemas
- Request-side helpers such as IP and geolocation extraction
- Shared auth and recovery-code helpers
Entrypoints
Root
@caffeinebounce/shared-utils
Notable exports
generateRecoveryCodesgetDisplayNameParsedUserMetadataparseUserMetadataRawUserMetadataDeviceFingerprintgenerateDeviceFingerprintnowgetEmailDomainformatCompactCurrencyformatCurrencyformatDate
Build targets
- ./dist/index.d.ts
- ./dist/index.js
- ./dist/index.mjs
Formatters
@caffeinebounce/shared-utils/formatters
Formatting utilities for dates, numbers, currency, and more.
Notable exports
formatDateformatDateTimeformatPhoneNumberformatPhoneInputformatCurrencyformatCompactCurrencyformatPercentageformatNumber
Build targets
- ./dist/formatters.d.ts
- ./dist/formatters.js
- ./dist/formatters.mjs
Image
@caffeinebounce/shared-utils/image
Image processing utilities for compression and manipulation.
Notable exports
CompressImageOptionscompressImagecompressImageAsFilegetImageDimensions
Build targets
- ./dist/image.d.ts
- ./dist/image.js
- ./dist/image.mjs
String
@caffeinebounce/shared-utils/string
String manipulation utilities.
Notable exports
getInitialsensureAbsoluteUrltruncateslugifycapitalizenormalizeEmailpluralize
Build targets
- ./dist/string.d.ts
- ./dist/string.js
- ./dist/string.mjs