abc-ut
v0.0.2
Published
function
Downloads
4
Readme
abc-ut
A comprehensive utility library providing essential functions for various common tasks in TypeScript/JavaScript applications.
📦 Installation
# If using within the monorepo
pnpm add abc-ut
# For external usage
pnpm install abc-ut🚀 Features
This package provides utility functions organized into different modules:
- Calculate - Mathematical calculations and computations
- Contact - Contact information processing and validation
- Crypto - Cryptographic operations and security utilities
- Device - Device detection and platform utilities
- Event - Event handling and management utilities
- Image - Image processing and manipulation utilities
- JSON - JSON parsing, validation, and manipulation
- Math - Advanced mathematical operations
- PayPal - PayPal integration utilities
- Session - Session management and storage utilities
- SW - Service Worker utilities
- Time - Date, time, and timezone utilities
- Validate - Data validation and sanitization
📖 Usage
Basic Import
// Import from main entry point
import { utils } from "abc-ut";
// Import specific modules
import { calculate } from "abc-ut/calculate";
import { crypto } from "abc-ut/crypto";
import { validate } from "abc-ut/validate";Module Examples
Calculate Module
import { calculate } from "abc-ut/calculate";
// Example usage (specific functions depend on implementation)
const result = calculate.percentage(50, 200); // 25%
const tax = calculate.tax(100, 0.1); // 10Crypto Module
import { crypto } from "abc-ut/crypto";
// Encrypt/decrypt operations
const encrypted = crypto.encrypt("sensitive data", "secret-key");
const decrypted = crypto.decrypt(encrypted, "secret-key");Validate Module
import { validate } from "abc-ut/validate";
// Data validation
const isValidEmail = validate.email("[email protected]");
const isValidPhone = validate.phone("+1234567890");Time Module
import { time } from "abc-ut/time";
// Time utilities
const formatted = time.format(new Date(), "YYYY-MM-DD");
const timezone = time.getTimezone();🏗️ Development
Prerequisites
- Node.js 18+
- pnpm (recommended package manager)
Setup
# Install dependencies
pnpm install
# Build the package
pnpm build
# Development mode with watch
pnpm dev
# Clean build artifacts
pnpm cleanProject Structure
packages/utils/
├── src/
│ ├── calculate/
│ ├── contact/
│ ├── crypto/
│ ├── device/
│ ├── event/
│ ├── image/
│ ├── json/
│ ├── math/
│ ├── paypal/
│ ├── session/
│ ├── sw/
│ ├── time/
│ ├── validate/
│ └── index.ts
├── package.json
└── README.md🔧 Build System
This package uses:
- tsup for building and bundling
- TypeScript 5.8.2 for type safety
- ESM module format
📦 Dependencies
Runtime Dependencies
abc-hx- Custom React hooksabc-model- Data models and typesabc-constants- Shared constantscrypto-js- Cryptographic functionsmixpanel-browser- Analytics integrationuuid- UUID generation
Development Dependencies
@repo/eslint-config- Shared ESLint configuration- Various TypeScript type definitions
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
This project is part of the monorepo and follows the same license terms.
🆘 Support
For support and questions:
- Create an issue in the repository
- Check existing documentation
- Contact the development team
Note: This is an internal utility package designed for use within the monorepo ecosystem. Some functions may depend on other packages in the workspace.
