microkitjs
v1.0.4
Published
Modern, lightweight utility toolkit for JavaScript and TypeScript — including object, array, string, date, and validation helpers.
Maintainers
Readme
Modern, lightweight utility toolkit for JavaScript and TypeScript — including object, array, string, date, and validation helpers.
Features
- 🧠 Object utilities:
pick(),omit(),hasField() - 🔢 Array utilities:
unique(),flatten() - 🔡 String utilities:
capitalize(),kebabCase() - 📅 Date utilities:
isToday(),formatDate() - ✔️ Validation utilities:
isEmail(),isEmpty()
Installation
npm install microkitjs
# or
yarn add microkitjsUsage
Import individual utilities or the whole package:
import { pick, unique, capitalize, isToday, isEmail } from 'microkitjs';🧠 Object Utilities
const user = { name: 'Alice', age: 30, email: '[email protected]', active: true };
pick(user, ['name', 'email']);
// => { name: 'Alice', email: '[email protected]' }
omit(user, ['age', 'active']);
// => { name: 'Alice', email: '[email protected]' }
hasField(user, 'email');
// => true
hasField(user, 'password');
// => false🔢 Array Utilities
unique([1, 2, 2, 3, 4, 4]);
// => [1, 2, 3, 4]
flatten([1, [2, 3], [4, [5]]]);
// => [1, 2, 3, 4, [5]] // Note: only one level flattened🔡 String Utilities
capitalize('hello world');
// => 'Hello world'
kebabCase('Hello World Example');
// => 'hello-world-example'📅 Date Utilities
isToday(new Date());
// => true (if run on the same day)
formatDate(new Date(), 'YYYY-MM-DD');
// => '2025-06-15' (example output)✔️ Validation Utilities
isEmail('[email protected]');
// => true
isEmail('invalid-email');
// => false
isEmpty('');
// => true
isEmpty('not empty');
// => falseContributing We welcome contributions! Whether it's fixing bugs, improving docs, or adding new utilities, feel free to open issues and pull requests on the GitHub repository.
License
MIT © Nurul Islam Rimon
Links
Enjoy using microkitjs! 🚀
