Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A comprehensive collection of TypeScript utility functions for modern web develo

## Features

- 🛠️ **Comprehensive**: String, object, cookie, number, validation, format, and common utilities
- 🛠️ **Comprehensive**: String, object, cookie, number, validation, format, search query, and common utilities
- 📦 **Tree-shakable**: Import only what you need
- 🔒 **Type-safe**: Full TypeScript support with type definitions
- ⚡ **Lightweight**: Minimal dependencies and optimized for performance
Expand All @@ -31,6 +31,7 @@ import {
validationUtil,
commonUtil,
formatUtil,
searchQueryUtil,
} from "kr-corekit";

// String utilities
Expand Down Expand Up @@ -68,6 +69,9 @@ const notNull = commonUtil.isNull("hello"); // false
await commonUtil.sleep(1000); // Pauses execution for 1 second
const copied = await commonUtil.copyToClipboard("Hello, World!"); // true if successful

// Search Query utilities
const queryParams = searchQueryUtil.getAllQuery(); // { key: ["value1", "value2"], id: "123" }

// Cookie utilities
cookieUtil.setCookie("theme", "dark");
const theme = cookieUtil.getCookie("theme");
Expand Down Expand Up @@ -113,6 +117,10 @@ const formattedPhone = formatUtil.formatPhoneNumber("01012345678"); // "010-1234
- `sleep(ms: number): Promise<void>` - Pauses execution for a specified number of milliseconds
- `copyToClipboard(text: string): Promise<boolean>` - Copies text to the user's clipboard. Uses modern Clipboard API with fallback to legacy execCommand method. Returns true if successful, false if failed.

### SearchQueryUtil

- `getAllQuery(): Record<string, string | string[]>` - Parses the current URL's query string and returns an object with key-value pairs. Values appear as arrays when the same key is used multiple times.

### CookieUtil

- `setCookie(name: string, value: string, options?: object): void` - Sets a cookie
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kr-corekit",
"version": "0.0.4",
"version": "0.0.5",
"description": "A lightweight and modern utility toolkit for JavaScript and TypeScript. kr-corekit provides essential functions for strings, arrays, objects, and more, designed for simplicity and productivity.",
"keywords": [
"javascript",
Expand Down