Modern, lightweight utility toolkit for JavaScript and TypeScript — including object, array, string, date, and validation helpers.
- 🧠 Object utilities:
pick(),omit(),hasField() - 🔢 Array utilities:
unique(),flatten() - 🔡 String utilities:
capitalize(),kebabCase() - 📅 Date utilities:
isToday(),formatDate() - ✔️ Validation utilities:
isEmail(),isEmpty()
npm install microkitjs
# or
yarn add microkitjs
import { pick, unique, capitalize, isToday, isEmail } from 'microkitjs';
const user = { name: 'Alice', age: 30, email: 'alice@example.com', active: true };
pick(user, ['name', 'email']);
// => { name: 'Alice', email: 'alice@example.com' }
omit(user, ['age', 'active']);
// => { name: 'Alice', email: 'alice@example.com' }
hasField(user, 'email');
// => true
hasField(user, 'password');
// => false
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
capitalize('hello world');
// => 'Hello world'
kebabCase('Hello World Example');
// => 'hello-world-example'
isToday(new Date());
// => true (if run on the same day)
formatDate(new Date(), 'YYYY-MM-DD');
// => '2025-06-15' (example output)
isEmail('test@example.com');
// => true
isEmail('invalid-email');
// => false
isEmpty('');
// => true
isEmpty('not empty');
// => false
Contributing 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.
Enjoy using microkitjs! 🚀