Getting Started
Daily Toolset is a versatile utility library that provides helpful functions for everyday JavaScript/TypeScript needs. Designed to streamline daily coding tasks, these utilities cover string manipulation, object transformation, chunk splitting, unique string generation, and more.
With Daily Toolset, you’ll have access to powerful utilities for handling everyday coding tasks, improving productivity and code readability. Simply install and start leveraging functions designed to simplify and standardize JavaScript/TypeScript operations.
Installation
Install the package via npm:
npm install @explita/daily-toolset --save
Quick Examples
import { chunkSplit, uniqueString, transformObject } from "@explita/daily-toolset";
// Split a number into groups
console.log(chunkSplit(123456789, { groupSize: 3, separator: "," })); // "123,456,789"
// Generate a random password string
console.log(uniqueString({ length: 12, isPassword: true })); // e.g., "A7*b8s@5Kd3!"
// Transform a flattened object to nested
console.log(transformObject({ "a.b.c": "value" })); // { a: { b: { c: "value" } } }
For form components like Checkbox, Dialog, Popover, etc. The following packages are required:
npm install @radix-ui/react-checkbox @radix-ui/react-dialog @radix-ui/react-popover @radix-ui/react-radio-group @radix-ui/react-scroll-area @radix-ui/react-slot @radix-ui/react-switch class-variance-authority cmdk react-day-picker react-icons
And the components css file:
import "@explita/daily-toolset/dist/styles.css";
Type Safety
All functions are designed with TypeScript's strong typing system to ensure type safety and prevent runtime errors. They leverage generics to maintain the integrity of the original value types while modifying them.