Skip to content

Releases: HumanjavaEnterprises/nostr-crypto-utils

Release v0.4.3

30 Dec 01:42

Choose a tag to compare

Release v0.4.3

This release introduces enhanced logging capabilities and improved code quality across the library.

🌟 Highlights

  • Enhanced logging system with comprehensive error handling
  • Development mode pretty printing with timestamps
  • TypeScript type exports for logger
  • Export utility functions: encodeBytes and getPublicKeyHex

🔧 Changes

Added

  • Enhanced logging system with comprehensive error handling
  • Development mode pretty printing with timestamps
  • TypeScript type exports for logger
  • Export utility functions: encodeBytes and getPublicKeyHex

Changed

  • Updated logger implementation to follow project-wide standards
  • Improved error object formatting with stack traces
  • Enhanced development mode output formatting
  • Removed unused code and variables

Fixed

  • Error object serialization in logs now includes stack traces
  • Development mode logging now properly handles timestamps
  • Resolved lint issues in nip-19, nip-26, and validation utilities

📦 Installation

npm install nostr-crypto-utils@0.4.3

#Usage Example

import { logger, createLogger } from 'nostr-crypto-utils';

// Use default logger
logger.info('Starting application');

// Create component-specific logger
const authLogger = createLogger('auth');
authLogger.info({ userId: '123' }, 'User logged in');

// Error handling
try {
  // ... your code
} catch (err) {
  logger.error({ err }, 'Operation failed');
  // Error will be properly formatted with stack trace
}