codetrix
Version:
A lightweight lodash-style utility library
63 lines (39 loc) โข 1.54 kB
Markdown
# custom-utility-functions
A reusable, type-safe utility library for arrays, objects, strings, dates, and more.
---
## โจ Features
- ๐ข Array and number utilities
- ๐
Date helpers (`isBefore`, `getDay`, `setYear`, etc.)
- ๐ค String utilities
- โ
Type-safe, modular, tree-shakable
- ๐ฆ Lightweight and dependency-free
---
## ๐ฆ Installation
```bash
npm install codetrix
```
## ๐ง Usage
```
import { clamp } from 'codetrix/numbers';
const result = clamp(5, 0, 10); // 5
```
```
import { isWeekend } from 'codetrix/date/is';
isWeekend(new Date()); // true or false
```
## ๐งฐ Available Methods
| Category | Methods |
| --------------- | ------------------------------------------------- |
| **Array** | `compact`, `flatten`, `shuffle`, `unique` |
| **Date โ is/** | `isWeekend`, `isLeapYear`, `isSameDay`, `isToday` |
| **Date โ get/** | `getDay`, `getMonth`, `getYear`, `getWeekNumber` |
| **Date โ set/** | `setYear`, `setMonth`, `setDay`, `setTime` |
| **String** | `capitalize`, `camelCase`, `kebabCase`, `trimAll` |
| **Number** | `clamp`, `random`, `isEven`, `isOdd` |
## ๐งช Running Tests
```bash
npm npm test
```
## ๐ Sponsor This Project
If you find this library helpful, please consider [](https://github.com/sponsors/shivanshuJags)
Your support helps me continue maintaining and improving this project.