Usage Guide
Persian Tools provides a comprehensive set of utilities for Persian language processing. This guide covers the fundamental patterns and best practices for using the library.Import Patterns
Tree-Shaking (Recommended)
Import only the utilities you need for optimal bundle size:Namespace Import
Import the entire library under a namespace:CommonJS
For Node.js environments using CommonJS:Core Patterns
Number Processing
Text Validation
Validation
Configuration Options
Many utilities accept configuration objects for customized behavior:Number Conversion Options
Text Processing Options
Error Handling
Persian Tools utilities are designed to be robust and handle edge cases gracefully:Performance Considerations
🚀 Lazy Loading
🚀 Lazy Loading
Import utilities individually to enable tree-shaking and reduce bundle size.
📈 Caching
📈 Caching
For repeated operations with the same input, consider implementing your own caching layer.
⚡ Batch Processing
⚡ Batch Processing
For processing large datasets, process items in batches to avoid blocking the main thread.
