{"_id":"@akhilx/flog","_rev":"4-bd176dde1d0ea21a7306b2ffb134d078","name":"@akhilx/flog","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@akhilx/flog","version":"1.0.0","keywords":["logger","console","ansi","stylized logs","cli","chalk alternative"],"author":{"name":"Akhil Trivedi","email":"akhiltrivedix@gmail.com"},"license":"MIT","_id":"@akhilx/flog@1.0.0","maintainers":[{"name":"akhilx","email":"akhiltrivedix@gmail.com"}],"homepage":"https://github.com/AkhilTrivediX/flog#readme","bugs":{"url":"https://github.com/AkhilTrivediX/flog/issues"},"dist":{"shasum":"0d60cc12c63bcd823f136f1b286cfcd30990d03c","tarball":"https://registry.npmjs.org/@akhilx/flog/-/flog-1.0.0.tgz","fileCount":6,"integrity":"sha512-PFm4peVoc5+B7MuH/rWrrOi8vuwt6dtJc03BCCG5ZO4QWGTjQePts0I1y0jDuO9YgTESm+VME5m34l8L5W5npw==","signatures":[{"sig":"MEYCIQCyUTeNWPfvzgtPHIXh8VugRvGyVPVdL5Cm4RGklMX//gIhALPkiQhUvtnNrnOmUJ0zEpyUPI7TlU4VH9QNtDRvYUta","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9437},"main":"dist/index.cjs","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{"import":"./dist/index.mjs","require":"./dist/index.cjs"},"gitHead":"2fc9c26a8f0ace72b3644501b28fc6df9857234a","scripts":{"dev":"tsup --watch","build":"tsup","prepublishOnly":"npm run build"},"_npmUser":{"name":"akhilx","email":"akhiltrivedix@gmail.com"},"repository":{"url":"git+https://github.com/AkhilTrivediX/flog.git","type":"git"},"_npmVersion":"10.2.1","description":"A minimal and extensible ANSI-based logger with style and template support.","directories":{},"_nodeVersion":"20.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/flog_1.0.0_1746878404334_0.12114232090637334","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@akhilx/flog","version":"1.0.1","keywords":["logger","console","ansi","stylized logs","cli","chalk alternative"],"author":{"name":"Akhil Trivedi","email":"akhiltrivedix@gmail.com"},"license":"MIT","_id":"@akhilx/flog@1.0.1","maintainers":[{"name":"akhilx","email":"akhiltrivedix@gmail.com"}],"homepage":"https://github.com/AkhilTrivediX/flog#readme","bugs":{"url":"https://github.com/AkhilTrivediX/flog/issues"},"dist":{"shasum":"b593c5c723db38b2551bfd7fad6310aeb6cc81df","tarball":"https://registry.npmjs.org/@akhilx/flog/-/flog-1.0.1.tgz","fileCount":6,"integrity":"sha512-TeT7azBQnLQm1ezRnOLL3C/V5eJ0gKzt/Dk5OE7J+NUUbJ+LMJ36IYmLYjGpZZA6nni0xVqjniT6iT6pSKFN5A==","signatures":[{"sig":"MEYCIQDJSok/ROjCozfr8+16TL9H6bs15Rrz25QEjDjYQArcWwIhANsENvti1OjB9OjW2GYMa9zNFEKw/hluo7XauW8v7WXn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9557},"main":"dist/index.cjs","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{"import":"./dist/index.mjs","require":"./dist/index.cjs"},"gitHead":"5d1dc375273635d0f18e6a7967efc791b64bb2a4","scripts":{"dev":"tsup --watch","build":"tsup","prepublishOnly":"npm run build"},"_npmUser":{"name":"akhilx","email":"akhiltrivedix@gmail.com"},"repository":{"url":"git+https://github.com/AkhilTrivediX/flog.git","type":"git"},"_npmVersion":"10.2.1","description":"A minimal and extensible ANSI-based logger with style and template support.","directories":{},"_nodeVersion":"20.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/flog_1.0.1_1746879217340_0.6061021764508121","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@akhilx/flog","version":"1.0.2","keywords":["logger","console","ansi","stylized logs","cli","chalk alternative"],"author":{"name":"Akhil Trivedi","email":"akhiltrivedix@gmail.com"},"license":"MIT","_id":"@akhilx/flog@1.0.2","maintainers":[{"name":"akhilx","email":"akhiltrivedix@gmail.com"}],"homepage":"https://github.com/AkhilTrivediX/flog#readme","bugs":{"url":"https://github.com/AkhilTrivediX/flog/issues"},"dist":{"shasum":"28442b3ccdd6a22e6199fa6bdad30c67ecf31d33","tarball":"https://registry.npmjs.org/@akhilx/flog/-/flog-1.0.2.tgz","fileCount":6,"integrity":"sha512-8+XETv2vt9/ak/0/GLGVeshtysrZpZqC3zQQW3Q56JJk3gANzLi/XBrF1Rd6ATzmuotyR96/0QSw2eKMMcQmpA==","signatures":[{"sig":"MEUCICSJXkk71htD54Ks14POl+6ouUrJ5ny6xdVEriEZmlReAiEA7S/fyWJXV79dFpm4RCDkAnUzlU0+1G/pQkkcOEcw1Kg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9557},"main":"dist/index.cjs","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{"import":"./dist/index.mjs","require":"./dist/index.cjs"},"gitHead":"2123b55e62091cfea9b87572d587891055c35cfc","scripts":{"dev":"tsup --watch","build":"tsup","prepublishOnly":"npm run build"},"_npmUser":{"name":"akhilx","email":"akhiltrivedix@gmail.com"},"repository":{"url":"git+https://github.com/AkhilTrivediX/flog.git","type":"git"},"_npmVersion":"10.2.1","description":"A minimal and extensible ANSI-based logger with style and template support.","directories":{},"_nodeVersion":"20.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/flog_1.0.2_1746882654027_0.06699082247439736","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@akhilx/flog","version":"1.0.3","description":"A minimal and extensible ANSI-based logger with style and template support.","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","scripts":{"build":"tsup","dev":"tsup --watch","prepublishOnly":"npm run build"},"exports":{"require":"./dist/index.cjs","import":"./dist/index.mjs"},"author":{"name":"Akhil Trivedi","email":"akhiltrivedix@gmail.com"},"license":"MIT","devDependencies":{"@types/node":"^22.15.17","tsup":"^8.4.0","typescript":"^5.8.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/AkhilTrivediX/flog.git"},"homepage":"https://github.com/AkhilTrivediX/flog#readme","keywords":["logger","console","ansi","stylized logs","cli","chalk alternative"],"_id":"@akhilx/flog@1.0.3","gitHead":"913fee07277130d8cc3464a4774a985c3dfa1935","bugs":{"url":"https://github.com/AkhilTrivediX/flog/issues"},"_nodeVersion":"20.16.0","_npmVersion":"10.2.1","dist":{"integrity":"sha512-e0jzfntx48mv2Laif+xbvOWf20lQDBcOZSeg8ut7YTAt7X5zT5CR8BCKc20ZlWj8b19IrusbJRDFwvotYr3utQ==","shasum":"630a0334d16a1445b4b8931554378a7f02152d0d","tarball":"https://registry.npmjs.org/@akhilx/flog/-/flog-1.0.3.tgz","fileCount":6,"unpackedSize":14446,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEMBMgNoWvhQoGwCSUHcTDWk/pvI8CX4hN4lx+DL1eVGAiEAnrsRosBY+Ynvi732bY6Icl1OnBR8v8p2mkMTn8h7yNo="}]},"_npmUser":{"name":"akhilx","email":"akhiltrivedix@gmail.com"},"directories":{},"maintainers":[{"name":"akhilx","email":"akhiltrivedix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/flog_1.0.3_1747233062989_0.8555860139694917"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-10T12:00:04.224Z","modified":"2025-05-14T14:31:03.362Z","1.0.0":"2025-05-10T12:00:04.513Z","1.0.1":"2025-05-10T12:13:37.519Z","1.0.2":"2025-05-10T13:10:54.244Z","1.0.3":"2025-05-14T14:31:03.158Z"},"bugs":{"url":"https://github.com/AkhilTrivediX/flog/issues"},"author":{"name":"Akhil Trivedi","email":"akhiltrivedix@gmail.com"},"license":"MIT","homepage":"https://github.com/AkhilTrivediX/flog#readme","keywords":["logger","console","ansi","stylized logs","cli","chalk alternative"],"repository":{"type":"git","url":"git+https://github.com/AkhilTrivediX/flog.git"},"description":"A minimal and extensible ANSI-based logger with style and template support.","maintainers":[{"name":"akhilx","email":"akhiltrivedix@gmail.com"}],"readme":"# flog — Minimal and Styled Console Logger ✨\r\n\r\n`flog` is a lightweight, zero-dependency console logger that lets you style terminal output using ANSI codes with ease. Think of it as a minimalist alternative to `chalk`, but with smart helpers and presets.\r\n\r\n---\r\n## ✨ Features\r\n\r\n- 🔹 **Premade shortcuts**: `flog.success()`, `flog.info()`, `flog.warn()`, `flog.error()`\r\n- 🎨 **Custom styles**: Use `flog.style()` to apply multiple ANSI styles, foregrounds, backgrounds\r\n- 🟦 **Supports**: `hex`, `bgHex`, `rgb`, `bgRgb` for true color output\r\n- 🧩 **Presets**: Create reusable styles with `flog.addPreset('name', 'style')`\r\n- ⚙️ **Smart Loading**: Visualize promise waiting using `flog.loader()`.\r\n- 🪶 Zero dependencies & Lightweight\r\n\r\n---\r\n\r\n## 📦 Installation\r\n\r\n```bash\r\nnpm install @akhilx/flog\r\n```\r\n\r\n---\r\n\r\n## 🚀 Quick Start\r\n\r\n```ts\r\nimport flog from '@akhilx/flog';\r\n\r\n// Built-in styles\r\nflog('This is a simple text!')\r\nflog.info('Fetching data from API...');\r\nflog.success('Successfully fetched!');\r\nflog.warn('Data fetched is in wrong format!');\r\nflog.error('Failed to Fetch Data!');\r\n```\r\n\r\n![Built-In Style Demo](assets/demo1.png)\r\n\r\nIf you're using CommonJS:\r\n\r\n```js\r\nconst flog = require('@akhilx/flog').default;\r\n```\r\n\r\n## 💫 Promise Spinners and Loaders\r\n\r\n```ts\r\n//Use Spinners to wait for single promise\r\nflog.loader(fetch('api.example.com'),'Waiting for response.');\r\nflog.loader(fetch('api.example.com'), 'Waiting for response', 'Response Received', 'Request Failed'); //Custom success and fail messages.\r\n// ⚠️ Do not use await while passing promise to loader function. flog.loader(await fetch...) ❌\r\n\r\n//Using multiple promises for Percentage Animation\r\nconst responses = await flog.loader([\r\n    fetch('api.example.com'),\r\n    fetch('api.example2.com'),\r\n    updateDb(data),\r\n    //Other operations\r\n], 'Updating Data...');\r\nconsole.log('Responses:', responses);\r\n```\r\n\r\n![Loader](assets/demo3.gif)\r\n\r\n---\r\n\r\n## 🎨 Advanced Usage with `flog.style(...)`\r\n\r\nApply one or more styles using keywords:\r\n\r\n```ts\r\nflog.style('red underline', 'Styled message');\r\nflog.style('bgBlue bold', 'Important alert');\r\nflog.style('blue bgYellow italic', 'Color combo!');\r\n```\r\n\r\n![Styles](assets/demo2.png)\r\n\r\n### ✅ Supported styles (partial)\r\n\r\n| Category          | Examples                                         |\r\n| ----------------- | ------------------------------------------------ |\r\n| Text Styles       | `bold`, `dim`, `italic`, `underline`, `blinking` |\r\n| Foreground Colors | `red`, `blue`, `green`, `yellow`, etc.           |\r\n| Background Colors | `bgRed`, `bgBlue`, `bgWhite`, etc.               |\r\n\r\n---\r\n\r\n### 🎨 Hex & RGB Support\r\n\r\nUse full 24-bit color via `hex`, `bgHex`, `rgb`, `bgRgb` syntax:\r\n\r\n```ts\r\nflog.style('hex-[#ff6347]', 'Tomato Red Text');\r\nflog.style('bgHex-[#1e90ff]', 'Dodger Blue BG');\r\n\r\nflog.style('rgb-[220, 20, 60]', 'I like Crimson');\r\nflog.style('bgRgb-[66,245,161]', 'What is this color?');\r\n```\r\n\r\n*Syntax:*\r\n\r\n* `hex-[#<hexcode>]` → foreground\r\n* `bgHex-[#<hexcode>]` → background\r\n* `rgb-[r,g,b]` → foreground\r\n* `bgRgb-[r,g,b]` → background\r\n\r\n---\r\n\r\n## 📦 Add Custom Presets\r\n\r\nDefine your own style shortcuts:\r\n\r\n```ts\r\nflog.addPreset('danger', 'red bold underline');\r\nflog.danger('This is dangerous!');\r\n```\r\n\r\n---\r\n\r\n## ⚙️ Icon Toggle\r\n\r\nIcons (✅, ℹ️, ⚠️, ❌) are shown by default in the built-in functions. You can disable them if needed:\r\n\r\n```ts\r\nflog.disableIcons();\r\nflog.success('Icons are now hidden');\r\n\r\nflog.enableIcons();\r\nflog.success('Icons are back!');\r\n```\r\n\r\n---\r\n\r\n## 📚 API Reference\r\n\r\n| Method                         | Description             |\r\n| ------------------------------ | ----------------------- |\r\n| `flog(...args)`                | Plain logger (no style) |\r\n| `flog.success(...args)`        | Green ✅ message         |\r\n| `flog.info(...args)`           | Blue ℹ️ message         |\r\n| `flog.warn(...args)`           | Yellow ⚠️ message       |\r\n| `flog.logger(Promise \\| Promises[], msg...)`          | Promise Spinner or loaders           |\r\n| `flog.error(...args)`          | Red ❌ message           |\r\n| `flog.style(styles, ...args)`  | Apply multiple styles   |\r\n| `flog.addPreset(name, styles)` | Add custom logger       |\r\n| `flog.disableIcons()`          | Turn off emojis         |\r\n| `flog.enableIcons()`           | Re-enable emojis        |\r\n\r\n---\r\n\r\n## 📄 License\r\n\r\nMIT © [Akhil](https://github.com/AkhilTrivediX)\r\n\r\n---\r\n\r\n## 🌟 Star & Help building this repo\r\n\r\nIf you find this useful, please ⭐️ the repo:\r\n[https://github.com/AkhilTrivediX/flog](https://github.com/AkhilTrivediX/flog)\r\n\r\n","readmeFilename":"README.md"}