- Object Inspection - Safely navigate nested structures with
inspect()
- Deep Merging - Type-safe object merging with
merge()
- Data Transformation - Chainable
map()
,filter()
,reduce()
operations
- 40+ Type Guards - Runtime validation with
isString
,isObject
,isPromise
, etc. - Advanced Types -
Maybe<T>
,Dictionary<T>
,Nullable<T>
, and other essential helpers - HTTP Status Codes - Full
HttpStatus
enum with RFC-compliant values
- Colorful console output π
- Context-aware logging
- Multiple log levels (
error
,warn
,info
,debug
,verbose
)
- Standardized HTTP exceptions
- RFC 7807 Problem Details format
- Custom error creation utilities
npm install @medishn/toolkit
# or
yarn add @medishn/toolkit
import { inspect, Logger, HttpStatus } from '@medishn/toolkit';
// Object Inspection
const userData = inspect(rawData).to('profile').get('email');
// Logging
const logger = new Logger({ context: 'Auth' });
logger.info('User logged in', { userId: 123 });
// Error Handling
throw new NotFoundException({
detail: 'Resource not found',
status: HttpStatus.NOT_FOUND,
});
// Type Safety
if (isDate(someValue)) {
console.log('Timestamp:', someValue.toISOString());
}
Explore our comprehensive guides:
- Object Inspection & Manipulation
- Logging Best Practices
- Error Handling Guide
- Http Exception Handling Guide
- Merge Object And Arrau Guide
- Type Guard Utilities Guide
- Type Utilities Reference
- Full API Documentation
We welcome contributions! Please see our:
Found a bug? Have a feature request?
Open an Issue
Get quick help: bitsgenix@gmail.com
β Love this package? Leave a star on GitHub to show your support!