1.0.4 • Published 5 months ago

@medishn/toolkit v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@medishn/toolkit

npm version License: MIT PRs Welcome

Features

Core Utilities

  • Object Inspection - Safely navigate nested structures with inspect()
  • Deep Merging - Type-safe object merging with merge()
  • Data Transformation - Chainable map(), filter(), reduce() operations

Type Safety

  • 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

Logging

  • Colorful console output 🌈
  • Context-aware logging
  • Multiple log levels (error, warn, info, debug, verbose)

Error Handling

  • Standardized HTTP exceptions
  • RFC 7807 Problem Details format
  • Custom error creation utilities

Installation šŸ“¦

npm install @medishn/toolkit
# or
yarn add @medishn/toolkit

Quick Start šŸš€

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());
}

Documentation šŸ“š

Explore our comprehensive guides:


Contributing šŸ¤

We welcome contributions! Please see our:


Support & Feedback šŸ’¬

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!

1.0.4

5 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago