{"_id":"@abxvn/logger","_rev":"1-6f62ac9acd7d93919cbf49f77e3e9dd8","name":"@abxvn/logger","dist-tags":{"latest":"2.0.1"},"versions":{"2.0.0":{"name":"@abxvn/logger","description":"Logger helpers and collapsible logs","version":"2.0.0","license":"MIT","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/abxvnvn/source.git","directory":"packages/logger"},"keywords":["abx","logger","collapse","ansi","interactive"],"author":{"name":"Hung Luu","email":"hungluu2106@gmail.com"},"bugs":{"url":"https://github.com/abxvnvn/source/issues?q=is%3Aopen+is%3Aissue+label%3A%22package%3Alogger%22"},"homepage":"https://github.com/abxvnvn/source/tree/main/packages/logger#readme","devDependencies":{"@types/node":"^20.1.3","ansi-colors":"^4.1.3"},"_id":"@abxvn/logger@2.0.0","_integrity":"sha512-xXZFJJ+/X40JkuuA6TvRgv0oTfRQeJFB05riKF0Iv5XJ7WSG8QR3tJQqPgiSq477vPHUbuQR90CdscqcPWJGEw==","_resolved":"/private/var/folders/0_/q3400kzn4kbflmypl6nnsf4m0000gn/T/6080971449ce1d193c5738b42be23e22/abxvn-logger-2.0.0.tgz","_from":"file:abxvn-logger-2.0.0.tgz","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-xXZFJJ+/X40JkuuA6TvRgv0oTfRQeJFB05riKF0Iv5XJ7WSG8QR3tJQqPgiSq477vPHUbuQR90CdscqcPWJGEw==","shasum":"11fecb11846f36c88dd53596c66572bf045a19c8","tarball":"https://registry.npmjs.org/@abxvn/logger/-/logger-2.0.0.tgz","fileCount":6,"unpackedSize":24712,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICpgv0mCRaAZKyPdCiPB3gI48wOvu9dV1lkIhyJggDZCAiEAm/uY1Ipxw/CQBifrezY9k/CtcHxophGCiDpRbtKwrCg="}]},"_npmUser":{"name":"hungluu","email":"luuhug@gmail.com"},"directories":{},"maintainers":[{"name":"hungluu","email":"luuhug@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_2.0.0_1703651714288_0.42742161864236317"},"_hasShrinkwrap":false},"2.0.1":{"name":"@abxvn/logger","description":"Logger helpers and collapsible logs","version":"2.0.1","license":"MIT","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/abxvn/source.git","directory":"packages/logger"},"keywords":["abx","logger","collapse","ansi","interactive"],"author":{"name":"Hung Luu","email":"hungluu2106@gmail.com"},"bugs":{"url":"https://github.com/abxvn/source/issues?q=is%3Aopen+is%3Aissue+label%3A%22package%3Alogger%22"},"homepage":"https://github.com/abxvn/source/tree/main/packages/logger#readme","devDependencies":{"@types/node":"^20.1.3","ansi-colors":"^4.1.3"},"_id":"@abxvn/logger@2.0.1","_integrity":"sha512-rCg85U3hM96iEl2QR3on1sQy91a89aqZ80NU377zqfV2kZ6B4KbDM01GcFmHZ70J0WIjXq/alF3z8siIyud0ow==","_resolved":"/private/var/folders/0_/q3400kzn4kbflmypl6nnsf4m0000gn/T/f6bc25de455409f4c307cc2b866779e4/abxvn-logger-2.0.1.tgz","_from":"file:abxvn-logger-2.0.1.tgz","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-rCg85U3hM96iEl2QR3on1sQy91a89aqZ80NU377zqfV2kZ6B4KbDM01GcFmHZ70J0WIjXq/alF3z8siIyud0ow==","shasum":"eba4ad5755463a91ecb654d10adc78a69b7d21b2","tarball":"https://registry.npmjs.org/@abxvn/logger/-/logger-2.0.1.tgz","fileCount":6,"unpackedSize":24698,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDO/u6P9ZCJiOedvCsAYbxN/Y0NSwISlNOeNyJX+Cm2WgIgQO7Xz2GRvLPRTT1oRaRJehbCRh+vz4WQU3XQEH8VfWs="}]},"_npmUser":{"name":"hungluu","email":"luuhug@gmail.com"},"directories":{},"maintainers":[{"name":"hungluu","email":"luuhug@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_2.0.1_1703656738153_0.35703161054195864"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-27T04:35:14.185Z","2.0.0":"2023-12-27T04:35:14.514Z","modified":"2023-12-27T05:58:58.572Z","2.0.1":"2023-12-27T05:58:58.363Z"},"maintainers":[{"name":"hungluu","email":"luuhug@gmail.com"}],"description":"Logger helpers and collapsible logs","homepage":"https://github.com/abxvn/source/tree/main/packages/logger#readme","keywords":["abx","logger","collapse","ansi","interactive"],"repository":{"type":"git","url":"git+https://github.com/abxvn/source.git","directory":"packages/logger"},"author":{"name":"Hung Luu","email":"hungluu2106@gmail.com"},"bugs":{"url":"https://github.com/abxvn/source/issues?q=is%3Aopen+is%3Aissue+label%3A%22package%3Alogger%22"},"license":"MIT","readme":"@abxvn/logger\n=====\n[![build][badge-build]][changelog]\n[![version][npm-version-badge]][npm-url]\n[![downloads][npm-downloads-badge]][npm-url]\n\nAn utility logger for CLI and web, to be reused in our projects\n\n**Table of contents**\n* [Features:](#features)\n* [Examples](#examples)\n  + [Collapsible console logs](#collapsible-console-logs)\n  + [Collapsible streams](#collapsible-streams)\n  + [Manipulate other streams](#manipulate-other-streams)\n  + [Styled loggers](#styled-loggers)\n* [Changelog](#changelog)\n* [Contribution](#contribution)\n\nFeatures:\n-----\n+ Collapsible:\n  - Designed to work as a log stream\n  - Stream writer can be piped and collapsed (replace previous lines with new data)\n  - Add watcher to collapse other streams (supports process.stdout and process.stderr too)\n  - Handle ANSI escape codes\n+ Styled Loggers:\n  - Some helper methods for styled loggers\n  - Support both browser and CLI color logging\n\nExamples\n-----\n### Collapsible console logs\n\n```typescript\nimport { collapse } from '@abxvn/logger/cli'\n\n// These 2 lines are writen into stdout\ncollapse.write(`A`)\ncollapse.write(`B`)\n\n// Previous 2 lines will be removed\ncollapse.collapse()\n```\n\n### Collapsible streams\n\n```typescript\nimport { collapsible } from '@abxvn/logger/cli'\n\ncollapsible(process.stdout)\ncollapsible(process.stderr)\ncollapsible(<anyWritableStream>)\n```\n\n### Manipulate other streams\n\n```typescript\nimport { collapsible } from '@abxvn/logger/cli'\n\n// All data writen into stdout will be collected\n// And can be collapse / hidden later\nconst stream = collapsible(process.stdout, true)\n\nstream.collapse()\n```\n\n### Styled loggers\n\nFor browser:\n```typescript\nimport { styles, logInfo } from '@abxvn/logger'\n\nconsole.log(color, badge, bold, underline)\n\ncolor('text', 'blue')\nbadge('text', 'red', 'white') // white text badge with red background\n\nbold('bold-text')\nlogInfo(underline('underlined-text'))\n```\n\nFor CLI:\n```typescript\nimport { styles, logInfo } from '@abxvn/logger/cli'\n\nconsole.log(color, badge, bold, underline)\n\ncolor('text', 'blue')\nbadge('text', 'red', 'white') // white text badge with red background\n\nbold('bold-text')\nlogInfo(underline('underlined-text'))\n```\n\nChangelog\n-----\nSee [CHANGELOG.md][changelog]\n\nContribution\n-----\n\nAll PRs and ideas for improvement are welcomed. \n\nIf you got any issues using this package, don't hesitate to create new [🐞 Bug report][issues] with a proper `package:<name>` label.\n\nFeel free to clone this project, make changes that your feel necessary and pull request anytime you want.\n\nInstall dependencies and run development build:\n```\npnpm install\npnpm start\n```\n\n**Working on your first Pull Request?**\n\nYou can learn how from this free video series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)\n\nTo help you get your feet wet and get you familiar with our contribution process, we have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place to get started.\n\n-----\nCheers 🍻\n\n[changelog]: https://github.com/abxvn/source/blob/main/packages/logger/CHANGELOG.md\n[issues]: https://github.com/abxvn/source/issues?q=is%3Aopen+is%3Aissue+label%3Apackage%3Alogger\n[good-first]: https://github.com/abxvn/source/issues?q=is%3Aopen+is%3Aissue+label%3Aflag%3Agood-first\n[badge-build]: https://github.com/abxvn/source/actions/workflows/build.yaml/badge.svg\n[npm-url]: https://www.npmjs.com/package/@abxvn/logger\n[npm-downloads-badge]: https://img.shields.io/npm/dw/@abxvn/logger\n[npm-version-badge]: https://img.shields.io/npm/v/@abxvn/logger\n","readmeFilename":"README.md"}