{"_id":"@craftycodesmith/plug-and-play-logger","_rev":"9-463d14eb4abb3f7565ddd4e62c53bc3a","name":"@craftycodesmith/plug-and-play-logger","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.0":{"name":"@craftycodesmith/plug-and-play-logger","version":"1.0.0","_id":"@craftycodesmith/plug-and-play-logger@1.0.0","maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"dist":{"shasum":"918afd867cccd30d45864eba808559f0f33f6fa3","tarball":"https://registry.npmjs.org/@craftycodesmith/plug-and-play-logger/-/plug-and-play-logger-1.0.0.tgz","fileCount":5,"integrity":"sha512-RVmfdH3/UyHQCxiYTrrMA+2EEz3/PV+KGLIMb+zvggQF0sYkJ8kG6hrVQOHcNkq3cxa9oc+uA0sMZ4Elu9+ZmA==","signatures":[{"sig":"MEUCICIRU5+TqjsklW3FWM/MX72PSKHxRNZ616xSHdBBV08yAiEAgiTC1KrTobEmggvrUe7sFEMCCNrgLKWz27F/MHZE8Os=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4665},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"a86f6d9bd38c0e180bcbd290b51834dfb61c26eb","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"},"_npmVersion":"10.9.2","description":"A zero-config stream-intercepting logger for Node.js","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.0.8"},"_npmOperationalInternal":{"tmp":"tmp/plug-and-play-logger_1.0.0_1768461110148_0.394373168371124","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@craftycodesmith/plug-and-play-logger","version":"1.0.1","_id":"@craftycodesmith/plug-and-play-logger@1.0.1","maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"dist":{"shasum":"905262b6cba6d28516731008354f11d3594355a8","tarball":"https://registry.npmjs.org/@craftycodesmith/plug-and-play-logger/-/plug-and-play-logger-1.0.1.tgz","fileCount":5,"integrity":"sha512-GDxzMI6XngP0ZP8kr0+szwsSei79RJqPtsgNi+LM09Xy9xSKpgw8ENesqlxH+dy/8cXyqxuSXn+18ZzLQMABtg==","signatures":[{"sig":"MEUCIBXpW/7iLWZNl1P1hsHYSLOM8qxmH+gWxCb0NJyW+utHAiEA+f5QFflNT3evjeAJhvfLKKvTejw1RV+nQ8G2JTQXcks=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9313},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"19a0c1659cadbad64abd69466f56798fab4195c7","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"},"_npmVersion":"10.9.2","description":"A zero-config stream-intercepting logger for Node.js","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.0.8"},"_npmOperationalInternal":{"tmp":"tmp/plug-and-play-logger_1.0.1_1768463390310_0.9234532286904886","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@craftycodesmith/plug-and-play-logger","version":"1.0.2","_id":"@craftycodesmith/plug-and-play-logger@1.0.2","maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"dist":{"shasum":"3b4dba9f18a76cdc235e41a0a9d8e7984c91791a","tarball":"https://registry.npmjs.org/@craftycodesmith/plug-and-play-logger/-/plug-and-play-logger-1.0.2.tgz","fileCount":5,"integrity":"sha512-jW3AAclBB/W0eNjXqG6OPwL7rB8p2jEeXOJFgxhurLTL8zQQJA2isM6tdXZN9NyucH4TeCG1VlRXJr9kGvodcg==","signatures":[{"sig":"MEYCIQDTW9xZBVoK2zLdZbMjx21qOKDpS1QBB8hHsvOwoJWwIAIhAI5/m0kKOqznLF8CAfoYfcUZJUDh8ved9vYNNV2K2qcH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9309},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"f868273333fd34bcf86c092d7c89a0a4950b9c4e","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"},"_npmVersion":"10.9.2","description":"A zero-config stream-intercepting logger for Node.js","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.0.8"},"_npmOperationalInternal":{"tmp":"tmp/plug-and-play-logger_1.0.2_1768471677583_0.5055300220688652","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@craftycodesmith/plug-and-play-logger","version":"1.0.3","_id":"@craftycodesmith/plug-and-play-logger@1.0.3","maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"dist":{"shasum":"9c070abe7506c293896b0c1d268a2b4c01dff381","tarball":"https://registry.npmjs.org/@craftycodesmith/plug-and-play-logger/-/plug-and-play-logger-1.0.3.tgz","fileCount":5,"integrity":"sha512-ZkaKU3SMJQcm9AMvvp/F24nB7pRkXuMfVmcFVIPYEXdlBXFAH1QMwLiYGvjKAp6H/NNOQb40QnA1u9UryVf6yQ==","signatures":[{"sig":"MEUCIQDseTcnSNYWnYGxC8q9zJPqi+VhZudHFgD8bglI02TFrAIgFw3XoIOUyJiDbHIX4+28ixVhuGlyCsVRfpjMrVZNLLs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9309},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"f868273333fd34bcf86c092d7c89a0a4950b9c4e","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"},"_npmVersion":"10.9.2","description":"A zero-config stream-intercepting logger for Node.js","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.0.8"},"_npmOperationalInternal":{"tmp":"tmp/plug-and-play-logger_1.0.3_1768471775933_0.9319082256148956","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@craftycodesmith/plug-and-play-logger","version":"1.0.4","_id":"@craftycodesmith/plug-and-play-logger@1.0.4","maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"dist":{"shasum":"ec7aef0c7007490dc5612f02aeb22a241bd086d4","tarball":"https://registry.npmjs.org/@craftycodesmith/plug-and-play-logger/-/plug-and-play-logger-1.0.4.tgz","fileCount":5,"integrity":"sha512-NHO2sD3btXPxcVXlcOpyioA85GLfniWAvD/EV6Z/djWt8bn+Icuqjv1eDN3+69YBSr992LxcVLgmL6HmJArWDQ==","signatures":[{"sig":"MEQCIFCVV9MJpNWc9JQmU/DPJ16U0dCmB8w0RhBWfkUjYj+CAiBe0UEGI/V/lVoKe9Kacw4m2dH8qfaZBtjCRO2akItrOg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25071},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"f868273333fd34bcf86c092d7c89a0a4950b9c4e","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"},"_npmVersion":"10.9.2","description":"A zero-config stream-intercepting logger for Node.js","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.0.8"},"_npmOperationalInternal":{"tmp":"tmp/plug-and-play-logger_1.0.4_1768471815367_0.40782273513803124","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@craftycodesmith/plug-and-play-logger","version":"1.0.5","_id":"@craftycodesmith/plug-and-play-logger@1.0.5","maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"dist":{"shasum":"007976f1ad6fee9ce359993124bc13deb469a4bd","tarball":"https://registry.npmjs.org/@craftycodesmith/plug-and-play-logger/-/plug-and-play-logger-1.0.5.tgz","fileCount":5,"integrity":"sha512-tZZNxDgoCyeT+XSpb5ePwP5wfJc9fSgBz4mWf9s9F+srlASfq6W00mMoFhjVet0v260VYFCR3zR/kFKBSJhCBA==","signatures":[{"sig":"MEYCIQDinh9dR14xyp959EujaE3o8CdVRHhNHXCUzqCdEj2eeQIhAPZT8VqYdKto0jfyr+wW7SSTTsJ5Rl0+EYX4XHE4Q/w7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25071},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"f868273333fd34bcf86c092d7c89a0a4950b9c4e","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"},"_npmVersion":"10.9.2","description":"A zero-config stream-intercepting logger for Node.js","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.0.8"},"_npmOperationalInternal":{"tmp":"tmp/plug-and-play-logger_1.0.5_1768471911524_0.417830407365118","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@craftycodesmith/plug-and-play-logger","version":"1.0.6","_id":"@craftycodesmith/plug-and-play-logger@1.0.6","maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"dist":{"shasum":"b96944f43d381dc53c6eb8d5f98c3a58e7afaa58","tarball":"https://registry.npmjs.org/@craftycodesmith/plug-and-play-logger/-/plug-and-play-logger-1.0.6.tgz","fileCount":5,"integrity":"sha512-IOKM9AWpSTn0wTZrpiHE+LVpBuT6td6vuU5KG8YBoUrhSP8Nkxz2ztgtssgKbokHonj7RXbwHtwLf6AqR0nflA==","signatures":[{"sig":"MEYCIQCFYYrrho3Sz5CqyhlAZqwK0ReUeNGwqNJ+BSHy4iPZDAIhAJr2MiGrE63iabXktLHDNxo6zj+lGDNdrYKpXxpwtUe+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9309},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"f868273333fd34bcf86c092d7c89a0a4950b9c4e","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"},"_npmVersion":"10.9.2","description":"A zero-config stream-intercepting logger for Node.js","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.0.8"},"_npmOperationalInternal":{"tmp":"tmp/plug-and-play-logger_1.0.6_1768471981400_0.05119457093973101","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@craftycodesmith/plug-and-play-logger","version":"1.0.7","_id":"@craftycodesmith/plug-and-play-logger@1.0.7","maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"dist":{"shasum":"eece5f279c515a349388c855631727e63732deec","tarball":"https://registry.npmjs.org/@craftycodesmith/plug-and-play-logger/-/plug-and-play-logger-1.0.7.tgz","fileCount":5,"integrity":"sha512-ksnuHMY1n30RAhI4MNXHRgrbuSB7/7fZzBI2SMMKYoeFFUX+jb9igr26Eky8MzbjKvj6jhw6W/l5ppmQ/+m8cg==","signatures":[{"sig":"MEYCIQC6PQaRm8DMS85B4/T3gOHZK/rgHOepaUR0ua6Li3GciAIhAMO0LieExcxNOmiDudF9QWsLZv6NeB0lcX2AunIIle3H","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9297},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"f868273333fd34bcf86c092d7c89a0a4950b9c4e","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"},"_npmVersion":"10.9.2","description":"A zero-config stream-intercepting logger for Node.js","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.0.8"},"_npmOperationalInternal":{"tmp":"tmp/plug-and-play-logger_1.0.7_1768472332853_0.8362173921773908","host":"s3://npm-registry-packages-npm-production"}},"1.0.8":{"name":"@craftycodesmith/plug-and-play-logger","version":"1.0.8","description":"A zero-config stream-intercepting logger for Node.js","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"devDependencies":{"@types/node":"^25.0.8"},"_id":"@craftycodesmith/plug-and-play-logger@1.0.8","gitHead":"f868273333fd34bcf86c092d7c89a0a4950b9c4e","_nodeVersion":"22.13.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Witr1VRhwqH4S3aj9Y0c9hj89vBj2/hh/ZfUqOruEcyODXn49rmDx4KBeRw2e2tfukh8XZ4XYR5379l/28QSxw==","shasum":"cb3ab0ae3eccd813282f68eee3f875e249ab779f","tarball":"https://registry.npmjs.org/@craftycodesmith/plug-and-play-logger/-/plug-and-play-logger-1.0.8.tgz","fileCount":5,"unpackedSize":6964,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCQYXKp/rBPGgZxj9sHcIR0ilFyHOaQYz4GT6Qs10z9kAIhAIeysqDdQCx8J2CySZ+Gb+JnodW/GhsLqzwn2e7vAqFp"}]},"_npmUser":{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"},"directories":{},"maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plug-and-play-logger_1.0.8_1768472675662_0.7110064640952973"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-15T07:11:49.958Z","modified":"2026-01-15T10:24:35.912Z","1.0.0":"2026-01-15T07:11:50.281Z","1.0.1":"2026-01-15T07:49:50.467Z","1.0.2":"2026-01-15T10:07:57.725Z","1.0.3":"2026-01-15T10:09:36.069Z","1.0.4":"2026-01-15T10:10:15.559Z","1.0.5":"2026-01-15T10:11:51.680Z","1.0.6":"2026-01-15T10:13:01.551Z","1.0.7":"2026-01-15T10:18:53.016Z","1.0.8":"2026-01-15T10:24:35.798Z"},"description":"A zero-config stream-intercepting logger for Node.js","maintainers":[{"name":"craftycodesmith","email":"official.damandeepsingh@gmail.com"}],"readme":"﻿# @craftycodesmith/plug-and-play-logger\r\n\r\nA high-performance, zero-dependency Node.js logging utility. It provides \"set-and-forget\" stream interception, allowing you to record all `console.log` and `console.error` output directly to organized, rotated files on your server.\r\n\r\n## Key Features\r\n\r\n- **Zero-Code Integration**: Intercepts `stdout` and `stderr` automatically. No need to replace existing `console` calls.\r\n- **Timestamp Caching**: Optimized performance by caching the ISO timestamp string and updating it once per second to save CPU cycles.\r\n- **Buffered Writing**: Reduces Disk I/O by batching log entries in memory before flushing to the file system.\r\n- **Log Rotation**: Automatically rotates files when they exceed 10MB to prevent disk exhaustion.\r\n- **Fail-Safe**: Uses asynchronous streams to ensure the main application event loop remains non-blocking.\r\n\r\n---\r\n\r\n## Installation\r\n```bash\r\nnpm install @craftycodesmith/plug-and-play-logger\r\n```\r\n\r\n## Quick Start\r\n\r\n### For Node.js / Express\r\n\r\nInitialize the logger at the very top of your entry file (e.g., `app.js` or `index.js`).\r\n```javascript\r\nconst { PlugPlayLogger } = require(\"@craftycodesmith/plug-and-play-logger\");\r\n\r\nPlugPlayLogger.init({\r\n  dir: \"./logs\", // Directory for log files\r\n  filename: \"app.log\", // Current log file name\r\n  intercept: true, // Automatically capture console.log and console.error\r\n});\r\n\r\nconsole.log(\r\n  \"This message and all subsequent console logs will be saved to the file.\"\r\n);\r\n```\r\n\r\n### For NestJS\r\n\r\nAdd the initialization to your `main.ts` file before the application bootstrap. This ensures that even the internal NestJS startup logs are captured.\r\n```typescript\r\nimport { NestFactory } from \"@nestjs/core\";\r\nimport { AppModule } from \"./app.module\";\r\nimport { PlugPlayLogger } from \"@craftycodesmith/plug-and-play-logger\";\r\n\r\nasync function bootstrap() {\r\n  // Initialize logger before creating the Nest application\r\n  PlugPlayLogger.init({\r\n    dir: \"./logs\",\r\n    filename: \"nest-app.log\",\r\n    intercept: true, // Captures all NestJS system logs and console outputs\r\n  });\r\n\r\n  const app = await NestFactory.create(AppModule);\r\n\r\n  // Optional: Set up global prefix or other Nest configurations\r\n  await app.listen(3000);\r\n  console.log(`Application is running on: ${await app.getUrl()}`);\r\n}\r\nbootstrap();\r\n```\r\n","readmeFilename":"README.md"}