Utils
A collection of 47+ small, focused, tree-shakeable utilities for dates, colors, math, DOM operations and more. Built with TypeScript-first APIs and Luxon for date handling.
Categories
Date & timeFormatting, periods, seasons, moon phases and zodiac signs (Luxon-based).ColorConversions between hex, RGB, HSL and HSV color spaces.Math & numbersFormatting, rounding, step calculations and a seeded PRNG.DOM & browserDownloads, view transitions, printing and element checks.GeoHemisphere detection and point-in-polygon checks.ObjectPrototype chain inspection and property setters.FunctionDebounce and waitFor control-flow helpers.
Reference
- Constants —
CHECK,CROSS,MDASH,NDASH,NOOP - Types —
Constructor,Descriptorsplus the domain enums returned by the date helpers
Quick example
ts
import { formatDate, hexToRGB, mulberry32 } from '@basmilius/utils';
import { DateTime } from 'luxon';
formatDate(DateTime.now()); // localized date string
hexToRGB('#0070f3'); // [0, 112, 243]
const random = mulberry32(42); // seeded PRNG
random.next(); // deterministic 0..1 valueContinue with installation or pick a category above.