@aslam-dev/my-lib
v1.0.5
Published
Reusable utility + UI helper library
Readme
📦 @aslam-dev/my-lib
Reusable utility functions and React components designed to accelerate frontend development with consistent formatting, validation, and UI helpers.
🚀 Installation
npm install @aslam-dev/my-libFeatures
🧰 Utility Functions
- 📅 Date & time helpers
- 📞 Phone number formatting and validation
- 🔄 Data transformation helpers
🎨 React Components
- 🖼️ Image components with lazy loading and placeholders
- 📊 Chart components for data visualization
- 🧩 Form components with built-in validation
📚 Usage
📅 Date Utilities
import { getCurrentDate } from "@aslam-dev/my-lib";
const date = getCurrentDate();📞 Phone Utilities
import { formatPhoneNumber, validatePhoneNumber } from "@aslam-dev/my-lib";
formatPhoneNumber("9876543210", "IN");
validatePhoneNumber("9876543210", "IN");🔄 Transformers
import { groupByProperty } from "@aslam-dev/my-lib";
const grouped = groupByProperty(products, "category");📝 Note Component
import { Note } from "@aslam-dev/my-lib";
<Note title="Important" content="This is a reusable note component." />;📜 BigNote Component
import { BigNote } from "@aslam-dev/my-lib";
<BigNote title="Large Content Viewer" />;🧱 Library Structure
src/ ├── components/ │ ├── Note.tsx │ ├── BigNote.tsx │ └── index.ts ├── datetime.ts ├── phone.ts ├── transformers.ts └── index.ts
🎯 Design Goals
Reusability
Encapsulates commonly used UI and utility logic.
Performance
BigNote uses lazy chunk loading to avoid heavy DOM rendering.
Type Safety
Fully written in TypeScript with exported type definitions.
Lightweight
Minimal dependencies and optimized bundle output.
🛠️ Development
Build Library
npm run buildLocal Testing
npm packThen install the generated tarball inside another project.
📦 Package Exports
Consumers should import from the root:
import { Note, getCurrentDate } from "@aslam-dev/my-lib";🔧 Peer Dependencies
This library expects:
react >= 18;🗺️ Roadmap
- Add more UI primitives
- Expand transformer utilities
- Add unit tests
- Add Storybook documentation
- Improve accessibility support
