{"_id":"@10abdullahbutt/logger","name":"@10abdullahbutt/logger","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@10abdullahbutt/logger","version":"1.0.0","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"node test.js","prepare":"husky","lint":"tsc --noEmit","lint:fix":"tsc --noEmit"},"lint-staged":{"*.ts":["npm run lint"]},"keywords":["logger","logging","typescript","winston","chalk"],"author":"","license":"MIT","description":"A powerful, extensible logger utility for Node.js and TypeScript projects with colored output and Winston-like features","devDependencies":{"@types/chalk":"^0.4.31","@types/node":"^24.0.10","husky":"^9.1.7","lint-staged":"^15.2.2","typescript":"^5.8.3"},"dependencies":{"chalk":"^5.4.1"},"_id":"@10abdullahbutt/logger@1.0.0","gitHead":"5d6e8a0cc29aab7010b294d646cdea48d2fcf35c","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-q09g7OuKwRVdcFtTNxjvBhal4ArBpr3EmbzFLyUAKCO1JTQZPEybsyISIqc4KRtB4p5eDWaOh8UvPjmXicGa5A==","shasum":"9bf285b444a32fb409f02bb106c8704eb4079203","tarball":"https://registry.npmjs.org/@10abdullahbutt/logger/-/logger-1.0.0.tgz","fileCount":20,"unpackedSize":22931,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIC08grcd7W+fj8WJE9RHy99BGhX9Ko4NSqMYsRB8hoElAiBxG4JpPT90ZIPmP4vU90I1TZCdJBbdGAoM8HJskP5Nxw=="}]},"_npmUser":{"name":"10abdullahbutt","email":"naeem.dev@boolmind.com","actor":{"name":"10abdullahbutt","email":"naeem.dev@boolmind.com","type":"user"}},"directories":{},"maintainers":[{"name":"10abdullahbutt","email":"naeem.dev@boolmind.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/logger_1.0.0_1752077267367_0.8446584425967703"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-09T16:07:47.269Z","1.0.0":"2025-07-09T16:07:47.568Z","modified":"2025-07-09T16:07:47.826Z"},"maintainers":[{"name":"10abdullahbutt","email":"naeem.dev@boolmind.com"}],"description":"A powerful, extensible logger utility for Node.js and TypeScript projects with colored output and Winston-like features","keywords":["logger","logging","typescript","winston","chalk"],"license":"MIT","readme":"# @10abdullahbutt/logger\n\nA powerful, extensible logger utility for Node.js and TypeScript projects with colored output, Winston-like features, and multiple transport support.\n\n## Features\n\n- 🎨 **Colored Output**: Beautiful colored console output using chalk\n- 📝 **Multiple Formats**: Simple, detailed, and JSON formatting options\n- 🚀 **Winston-like API**: Familiar interface with transports and levels\n- ⚙️ **Configurable**: Customizable log levels, prefixes, and metadata\n- 📁 **File Transport**: Built-in file logging support\n- 🔧 **Extensible**: Easy to add custom transports\n\n## Installation\n\n```bash\nnpm install @10abdullahbutt/logger\n```\n\n## Basic Usage\n\n```typescript\nimport { logger, Logger } from '@10abdullahbutt/logger';\n\n// Simple logging\nlogger.info('Hello, world!');\nlogger.error('Something went wrong!');\n\n// With metadata\nlogger.info('User logged in', { userId: 123, timestamp: new Date() });\n```\n\n## Advanced Usage\n\n### Custom Logger Configuration\n\n```typescript\nimport { Logger, Logger.createFileTransport } from '@10abdullahbutt/logger';\n\nconst customLogger = new Logger({\n  level: 'debug',\n  prefix: 'MyApp',\n  colorize: true,\n  format: 'detailed',\n  timestamp: true\n});\n\n// Add file transport\nconst fileTransport = Logger.createFileTransport('./logs/app.log', 'info');\ncustomLogger.addTransport(fileTransport);\n\ncustomLogger.debug('Debug message');\ncustomLogger.warn('Warning!');\n```\n\n### Pre-configured Loggers\n\n```typescript\nimport { debugLogger, productionLogger, developmentLogger } from '@10abdullahbutt/logger';\n\n// Development logger with full debug output\ndevelopmentLogger.verbose('Detailed debug info');\n\n// Production logger with JSON format\nproductionLogger.warn('Production warning');\n```\n\n### Custom Transports\n\n```typescript\nimport { Logger } from '@10abdullahbutt/logger';\n\n// Custom transport for external logging service\nconst customTransport = Logger.createCustomTransport((message) => {\n  // Send to external service\n  console.log('External:', message);\n}, 'error');\n\nconst logger = new Logger();\nlogger.addTransport(customTransport);\n```\n\n## API Reference\n\n### Logger Options\n\n```typescript\ninterface LoggerOptions {\n  level?: 'debug' | 'info' | 'warn' | 'error' | 'log';\n  prefix?: string;\n  transports?: Transport[];\n  timestamp?: boolean;\n  colorize?: boolean;\n  format?: 'simple' | 'detailed' | 'json';\n}\n```\n\n### Methods\n\n- `debug(message, metadata?)` - Debug level logging\n- `info(message, metadata?)` - Info level logging\n- `logMessage(message, metadata?)` - General logging\n- `warn(message, metadata?)` - Warning level logging\n- `error(message, metadata?)` - Error level logging\n- `success(message, metadata?)` - Success logging (alias for log)\n- `verbose(message, metadata?)` - Verbose logging (alias for debug)\n\n### Winston-like Methods\n\n- `addTransport(transport)` - Add a new transport\n- `removeTransport(transport)` - Remove a transport\n- `setLevel(level)` - Change log level dynamically\n\n### Static Methods\n\n- `Logger.createFileTransport(filePath, level?)` - Create file transport\n- `Logger.createCustomTransport(writeFn, level?)` - Create custom transport\n\n## Examples\n\n### Different Format Styles\n\n```typescript\n// Simple format (default)\nconst simpleLogger = new Logger({ format: 'simple' });\n\n// Detailed format\nconst detailedLogger = new Logger({ format: 'detailed' });\n\n// JSON format for machine parsing\nconst jsonLogger = new Logger({ format: 'json' });\n```\n\n### Environment-based Configuration\n\n```typescript\nconst logger = new Logger({\n  level: process.env.NODE_ENV === 'production' ? 'warn' : 'debug',\n  colorize: process.env.NODE_ENV !== 'production',\n  format: process.env.NODE_ENV === 'production' ? 'json' : 'detailed'\n});\n```\n\n## License\n\nMIT ","readmeFilename":"README.md","_rev":"1-0f0be423457f46b72f47fac28bb96794"}