{"_id":"console-fmt-cli","_rev":"11-239f72baf89a8c74da73172210b4fd35","name":"console-fmt-cli","dist-tags":{"latest":"2.9.1"},"versions":{"2.0.0":{"name":"console-fmt-cli","version":"2.0.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.0.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"332c2bfb64f483e8862b374f6c51e11ab664194e","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.0.0.tgz","fileCount":4,"integrity":"sha512-dJWIpvtKRslWXIXxVZrHOGR8mg1/K+VnxpZSpcg2+7vK+5TZrMNG6uFE1KnnokRDlbHKG4jDXZQyt/mQQqMqaA==","signatures":[{"sig":"MEUCIBgjqEOUbVWBSwydIMNfdPiU3DEHMtDexLg7hG7yIvFnAiEA2QDUfAlLxMcNKuQ2XlEGgMB5VddDGS6iEoRchalfpwU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3992},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.0.0_1782773968734_0.5334549771368116","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"console-fmt-cli","version":"2.1.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.1.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"7b58a9e502026525eb9c3f2d45adb853b5efb485","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.1.0.tgz","fileCount":4,"integrity":"sha512-CMnt3QFB356sveT3WPd554/g0Cwjyn52CZikJo4b23+UgWd0+KmmwBRGCCHBc1y/o8jAbm2lyUlqU2Qk4kiSzA==","signatures":[{"sig":"MEYCIQC4s5ZO/yx0KNUMmdQUaWz36ZE3+ebZm8g7HWz5JT+ioAIhAKenHx9V0cvImPgtPplppmYWy+/T9B572N7/wvhSsl64","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3351},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.1.0_1782773995749_0.5641626473094983","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"console-fmt-cli","version":"2.2.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.2.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"590176ee088c870b04072e78989c526e895ff5c9","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.2.0.tgz","fileCount":4,"integrity":"sha512-QHtXoPnhnfUa3OJv+wkSRmUYbuF+Tzw4pb66QOB4t6Z3+8Ns1JM2vhefTRBdauf/y6NzTdoYmyW/WlMtJ86HGw==","signatures":[{"sig":"MEYCIQC+TqwktbvskorxzOrb7I0yUa97hqLgfKWjbBfkE84zywIhAI28IauTw6CxGqX7pogfmR7Q2Vr+hTGWXVPaziUjcjql","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3508},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.2.0_1782774010568_0.5781717588334956","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"console-fmt-cli","version":"2.3.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.3.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"be5eac44924c1fb423e2c37e3c2c49d07f5cbd3a","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.3.0.tgz","fileCount":4,"integrity":"sha512-HWCTCuD9FJwLOD7Gz6Tj5o5tRK8AR2dIM93rq37G5W2dCTyslPrJJSUnHkyFEaFKLEGQRW4lyXI5Iw+g1QnRgw==","signatures":[{"sig":"MEUCIQDJcxlrNAxhqzlG+acydU6Y+a2DhXg+vU46f0N6mGBfwQIgDiAAgFVR9Xq9HdF5igFN2+XdN9dgAd4xb4r1x4xff70=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3591},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.3.0_1782774034327_0.715733209709549","host":"s3://npm-registry-packages-npm-production"}},"2.4.0":{"name":"console-fmt-cli","version":"2.4.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.4.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"44e301fdb9117ce0aab2d9b60a338856e72a5d9d","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.4.0.tgz","fileCount":4,"integrity":"sha512-nFx3fLognnLE+URDFlJkQ9TwElqTfDUI7HbsAT5EmxTl86mQsGVIpm/Nrb4YDp60eazuZRwZCcaLJnbePtBlHw==","signatures":[{"sig":"MEUCIGv7Vf70t5yKgbUkgf4U+S7Y0CrNz6Cdz75Iw3U3FuU+AiEAnYoSq7vEGpaKyipQE8NrCBq43gHL7u221piB0ho5qF0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3584},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.4.0_1782774061656_0.9574910500676681","host":"s3://npm-registry-packages-npm-production"}},"2.5.0":{"name":"console-fmt-cli","version":"2.5.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.5.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"44ce8b173d0f2edeab5e7d3990fea75ae6687b37","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.5.0.tgz","fileCount":4,"integrity":"sha512-9tDXHru2DAneq0XiN5R8yVkLWhwQE797BM3/X552nkujAlfkbN1H8WdMjhSep7Og7gcs+mRJLyOkZiQrJQPvBQ==","signatures":[{"sig":"MEUCIQCyvkusdThBqlvgRNs9Nyfx59bQycNhJteWO4nOV1g7IwIgIrLylVB8sF5GSEynVE7WHUA0DHiHYfBkKln3iod53+c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3609},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.5.0_1782774101308_0.23776586980253178","host":"s3://npm-registry-packages-npm-production"}},"2.6.0":{"name":"console-fmt-cli","version":"2.6.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.6.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"4f94d950e3f776a779f8d26ead86a5ea36748b0f","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.6.0.tgz","fileCount":4,"integrity":"sha512-zFZk5DnQhjRmIkMJk5fSmTocpKTQqQao4VB2wF1vJOuJSK4ampWWFqsizTLTfG82qRaVaLlUT8oksOPp89YRgg==","signatures":[{"sig":"MEUCIQCYAEY1DeX5KHir1rqY2bQvBBQ0tCYIDpjzE4biOiCrlAIgKXD8Cawi6H9l+gHI4zRdyuOuHNAOu5mFPHA/vM7WFwk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3265},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.6.0_1782774894368_0.5629567863409519","host":"s3://npm-registry-packages-npm-production"}},"2.7.0":{"name":"console-fmt-cli","version":"2.7.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.7.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"38fa09c9005d2384fef01f28ffb3d7e0e0ba1254","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.7.0.tgz","fileCount":4,"integrity":"sha512-bfdZhlmMs9T5V9+jJDxK3tuXWbaJ5lyC7b81+gAZ3DWkWQ8V+DLhVsQ4vvzTNBOm9QgF1y9yRkFuPG7+5/pYGA==","signatures":[{"sig":"MEUCIQDcxPaWN+j04gkJfuR1vtCF5KaFIC6SU9M5sPYymjRQSwIgOIpkheZMqhTAcH2bRKEGujFtkEl0Kmjex+A/GW+X8Gc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3400},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.7.0_1782774928716_0.332225882393687","host":"s3://npm-registry-packages-npm-production"}},"2.8.0":{"name":"console-fmt-cli","version":"2.8.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.8.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"201c64ad6327d855ab0b314072602177d3fa4f96","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.8.0.tgz","fileCount":4,"integrity":"sha512-DE1FojlUK+qHZ32ZruoRmMDu5tmZu1WmfabZgFLVH3VXP4oSXdlNhnRPjfTNQGmmNNUHaOG7jsHkr3cNI601dQ==","signatures":[{"sig":"MEUCIGp5CWbBO1wricPai1XTIBjcjjpPU0o6KCq18gTxoh6gAiEA/dPJE/Zgb00pYA9snzjuMv+58Lt1Kw0fTZ8ORtMf5uY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3767},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.8.0_1782775033922_0.42256818475449687","host":"s3://npm-registry-packages-npm-production"}},"2.9.0":{"name":"console-fmt-cli","version":"2.9.0","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","_id":"console-fmt-cli@2.9.0","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"dist":{"shasum":"052c837156c6ddd976db4fff2da7e570e7031676","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.9.0.tgz","fileCount":4,"integrity":"sha512-PXdF2HT1VtFBdtj1XWeTf8KQ3xhVoHKhqAmXOfQv66wvqUY6WI4OoKozal4WDeZ42AbtMSlYibK8X2Nn2v3QEw==","signatures":[{"sig":"MEQCIEkLy0XmqA/h1CSxMie8xiCDuoN5Yt4OKvZKUKi8neyLAiALChnsW/i4XjM/4wX/KYpQ2uTnCfEPEcqAdDkbYV+Eiw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5946},"main":"index.js","type":"commonjs","_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"_npmVersion":"11.16.0","description":"Pretty console logger for Node.js CLI apps and services","directories":{},"_nodeVersion":"24.18.0","dependencies":{"decimal-format-core":">=3.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/console-fmt-cli_2.9.0_1782775063028_0.3306844549368797","host":"s3://npm-registry-packages-npm-production"}},"2.9.1":{"name":"console-fmt-cli","version":"2.9.1","description":"Pretty console logger for Node.js CLI apps and services","main":"index.js","keywords":["logger","console","cli","pretty","colors","log"],"license":"MIT","type":"commonjs","dependencies":{"decimal-format-core":">=3.0.0"},"_id":"console-fmt-cli@2.9.1","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-xdfQcAGdqL7pOBwQCMbhEHMBp2TR/7WwbPk1t36fkpZpIB3q11jRIWy2HI0MsoEk3eUe/3Nl9eCc5Hp0/Tzq5A==","shasum":"74799f42ecb87395bcd174f9a00a3cfdb3175452","tarball":"https://registry.npmjs.org/console-fmt-cli/-/console-fmt-cli-2.9.1.tgz","fileCount":4,"unpackedSize":6469,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDx2qamv38W93d77fal4vmZbR/jBfnGVklV92P2GnS9zwIhAJajV8nqWfwMrVwQfhIVPkVb+p85iGiHS6WCKkDxURMG"}]},"_npmUser":{"name":"ricmoo1","email":"tikphicha2511@gmail.com"},"directories":{},"maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/console-fmt-cli_2.9.1_1783922998918_0.4172123321012535"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-29T22:59:28.668Z","modified":"2026-07-13T06:09:59.135Z","2.0.0":"2026-06-29T22:59:28.858Z","2.1.0":"2026-06-29T22:59:55.851Z","2.2.0":"2026-06-29T23:00:10.705Z","2.3.0":"2026-06-29T23:00:34.445Z","2.4.0":"2026-06-29T23:01:01.817Z","2.5.0":"2026-06-29T23:01:41.422Z","2.6.0":"2026-06-29T23:14:54.505Z","2.7.0":"2026-06-29T23:15:28.844Z","2.8.0":"2026-06-29T23:17:14.071Z","2.9.0":"2026-06-29T23:17:43.193Z","2.9.1":"2026-07-13T06:09:59.034Z"},"license":"MIT","keywords":["logger","console","cli","pretty","colors","log"],"description":"Pretty console logger for Node.js CLI apps and services","maintainers":[{"name":"ricmoo1","email":"tikphicha2511@gmail.com"}],"readme":"# console-fmt-cli\n\n**Elegant, colorized console logging for Node.js** — with optional **[decimal-format-core](https://www.npmjs.com/package/decimal-format-core)** formatters for prediction-market and trading bots.\n\nVersion **2.9.0** is the recommended **`latest`** release: everything from 2.8.x plus re-exported stake and currency helpers so bot repos can depend on a **single package**.\n\n```bash\nnpm install console-fmt-cli\n```\n\n---\n\n## Install\n\n```bash\nnpm install console-fmt-cli\n# peer (optional but recommended for trading bots):\nnpm install decimal-format-core\n```\n\nNode.js 14+. `decimal-format-core` is loaded as a **peer-style optional dependency** — if missing, logger functions still work; formatters throw a clear require error.\n\n---\n\n## Quick start\n\n```javascript\nconst { createLogger } = require('console-fmt-cli');\n\nconst log = createLogger('polymarket-bot', {\n  level: process.env.LOG_LEVEL || 'info',\n  timestamps: true,\n  child: true,\n  time: true,\n});\n\nconst strategy = log.child('strategy');\nstrategy.info('started');\n```\n\n---\n\n## Trading / stake formatting (2.9.0)\n\nRe-exports from `decimal-format-core`:\n\n```javascript\nconst {\n  createLogger,\n  computeBoundedFraction,\n  computeKellyStake,   // alias\n  formatCurrency,\n  formatStakeUsd,      // alias\n  roundDecimal,\n  roundStake,          // alias\n} = require('console-fmt-cli');\n\nconst log = createLogger('stake', { timestamps: true });\n\nconst stake = computeKellyStake({\n  probability: 0.58,\n  allInPrice: 0.52,\n  bankroll: 2000,\n  maxStake: 100,\n  scaleFactor: 0.5,\n});\n\nlog.info(`size $${formatStakeUsd(stake)} (${roundStake(stake)} raw)`);\n```\n\n---\n\n## Logger API\n\n### `createLogger(name, options?)`\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `level` | `'info'` | Minimum level |\n| `timestamps` | `false` | ISO-8601 prefix |\n| `color` | `true` | ANSI colors |\n| `prefix` | `true` | `[name]` tag |\n| `json` | `false` | Adds `log.json(obj)` |\n| `child` | `false` | Adds `log.child(sub)` |\n| `time` | `false` | Adds `log.time(label)` |\n\n### Methods\n\n```javascript\nlog.debug(...args);\nlog.info(...args);\nlog.warn(...args);\nlog.error(...args);\nlog.json({ structured: true });     // when json: true\nlog.child('module');                // when child: true\nconst end = log.time('operation');  // when time: true\nend();\n```\n\n---\n\n## Recommended bot `log.js` wrapper\n\n```javascript\nconst { createLogger } = require('console-fmt-cli');\n\nlet root;\n\nfunction getLogger(module) {\n  if (!root) {\n    root = createLogger('bot', {\n      level: process.env.LOG_LEVEL || 'info',\n      timestamps: true,\n      child: true,\n      time: process.env.LOG_TIME === '1',\n      color: process.stdout.isTTY,\n    });\n  }\n  return module ? root.child(module) : root;\n}\n\nmodule.exports = { getLogger };\n```\n\n---\n\n## Why one dependency?\n\nTrading templates previously imported:\n\n- a CLI logger\n- a stake math package\n- duplicate rounding helpers\n\n2.9.0 consolidates the common path: **`console-fmt-cli` + optional `decimal-format-core`** matches what open Polymarket bot scaffolds expect.\n\n---\n\n## Version history\n\n| Version | Highlights |\n|---------|------------|\n| 2.0.0 | Initial logger |\n| 2.2.0 | JSON lines |\n| 2.3.0 | Child loggers |\n| 2.8.0 | Timers |\n| **2.9.0** | decimal-format-core formatters, npm `latest` |\n\n---\n\n## FAQ\n\n**Must I install `decimal-format-core`?**  \nOnly if you use `formatCurrency`, `computeKellyStake`, etc. Logging alone does not require it.\n\n**Pino / Winston?**  \nUse this for developer-facing CLI output; pipe JSON logs from `log.json()` into your collector if needed.\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}