{"id":19125602,"url":"https://github.com/dmitmel/telegraf-update-logger","last_synced_at":"2025-08-20T08:17:36.786Z","repository":{"id":32108254,"uuid":"130453672","full_name":"dmitmel/telegraf-update-logger","owner":"dmitmel","description":"Update logging middleware for Telegraf","archived":false,"fork":false,"pushed_at":"2023-01-08T15:03:51.000Z","size":788,"stargazers_count":10,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T17:22:33.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/telegraf-update-logger","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmitmel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-21T08:10:52.000Z","updated_at":"2023-01-25T01:59:55.000Z","dependencies_parsed_at":"2023-01-14T20:31:55.690Z","dependency_job_id":null,"html_url":"https://github.com/dmitmel/telegraf-update-logger","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/dmitmel/telegraf-update-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitmel%2Ftelegraf-update-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitmel%2Ftelegraf-update-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitmel%2Ftelegraf-update-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitmel%2Ftelegraf-update-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmitmel","download_url":"https://codeload.github.com/dmitmel/telegraf-update-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitmel%2Ftelegraf-update-logger/sbom","scorecard":{"id":347871,"data":{"date":"2025-08-11","repo":{"name":"github.com/dmitmel/telegraf-update-logger","commit":"f11c9f5f65df3751192d85902f4c6686937b3c62"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":1,"reason":"Found 2/18 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dmitmel/telegraf-update-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/dmitmel/telegraf-update-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/dmitmel/telegraf-update-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/dmitmel/telegraf-update-logger/ci.yaml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T07:34:05.903Z","repository_id":32108254,"created_at":"2025-08-18T07:34:05.903Z","updated_at":"2025-08-18T07:34:05.903Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271285534,"owners_count":24732930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T05:36:10.070Z","updated_at":"2025-08-20T08:17:36.767Z","avatar_url":"https://github.com/dmitmel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://telegram.org/\"\u003e\n    \u003cimg height=\"150\" src=\"https://cdn.worldvectorlogo.com/logos/telegram.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://telegraf.js.org/\"\u003e\n    \u003cimg height=\"150\" src=\"https://raw.githubusercontent.com/telegraf/telegraf/develop/docs/assets/logo.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# telegraf-update-logger\n\n[![CI](https://github.com/dmitmel/telegraf-update-logger/workflows/CI/badge.svg)](https://github.com/dmitmel/telegraf-update-logger/actions?query=workflow:CI)\n[![npm](https://img.shields.io/npm/v/telegraf-update-logger.svg)](http://npmjs.com/package/telegraf-update-logger)\n[![node](https://img.shields.io/node/v/telegraf-update-logger.svg)](https://nodejs.org)\n[![MIT License](https://img.shields.io/npm/l/telegraf-update-logger.svg)](http://opensource.org/licenses/MIT)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)\n\n\u003e [Update](https://core.telegram.org/bots/api#update) logging middleware for [Telegraf](http://telegraf.js.org/)\n\n![Example](example.png)\n\n_Font: [Ubuntu Mono](https://design.ubuntu.com/font/), Theme: [OceanicMaterial](https://github.com/mbadolato/iTerm2-Color-Schemes#oceanicmaterial)_\n\n## Install\n\n```bash\nyarn add telegraf-update-logger\n```\n\n## Examples\n\n### log all updates to console with colors\n\n```js\nconst Telegraf = require('telegraf');\nconst updateLogger = require('telegraf-update-logger');\n\nconst bot = new Telegraf(process.env.BOT_TOKEN);\nbot.use(updateLogger({ colors: true }));\nbot.startPolling();\n```\n\n### log channel posts to file\n\n```js\nconst Telegraf = require('telegraf');\nconst updateLogger = require('telegraf-update-logger');\n\nconst bot = new Telegraf(process.env.BOT_TOKEN);\nbot.use(\n  updateLogger({\n    filter: (update) =\u003e update.channel_post || update.edited_channel_post,\n    log: (str) =\u003e fs.appendFileSync('messages.log', str),\n  }),\n);\nbot.startPolling();\n```\n\n### log all updates with custom colors\n\n```js\nconst Telegraf = require('telegraf');\nconst updateLogger = require('telegraf-update-logger');\nconst chalk = require('chalk');\n\nconst bot = new Telegraf(process.env.BOT_TOKEN);\nbot.use(\n  updateLogger({\n    colors: {\n      id: chalk.red,\n      chat: chalk.yellow,\n      user: chalk.green,\n      type: chalk.bold,\n    },\n  }),\n);\nbot.startPolling();\n```\n\n### reply to all messages with formatted updates\n\n```js\nconst Telegraf = require('telegraf');\nconst updateLogger = require('telegraf-update-logger');\n\nconst bot = new Telegraf(process.env.BOT_TOKEN);\nbot.on('message', (ctx) =\u003e ctx.reply(updateLogger.format(ctx.update)));\nbot.startPolling();\n```\n\n## API\n\n### \u003ccode\u003eupdateLogger(options: object?): function\u003c/code\u003e\n\nCreates a middleware that logs every update and then invokes the next middleware.\n\n**Params**:\n\n- **`options`** `object?` `= {}`\n  - **`.filter`** \u003ccode\u003e(update: \u003ca href=\"https://core.telegram.org/bots/api#update\"\u003eUpdate\u003c/a\u003e) =\u003e boolean\u003c/code\u003e – a function that determines which updates should be logged\n  - **`.log`** `(formattedUpdate: string) =\u003e void` `= console.log` – a function that logs formatted updates\n  - **... [`format`](#updateloggerformatupdate-update-options-object-string) options**\n\n### \u003ccode\u003eupdateLogger.format(update: \u003ca href=\"https://core.telegram.org/bots/api#update\"\u003eUpdate\u003c/a\u003e, options: object?): string\u003c/code\u003e\n\nFormats an update as string.\n\n**Params**:\n\n- **`update`** [Update](https://core.telegram.org/bots/api#update)\n- **`options`** `object?` `= {}`\n  - **`.colors`** `boolean | object` `= false` – enables/disables/sets [colors](https://github.com/chalk/chalk/)\n    - **`.id`** `function` – a function that sets colors of message IDs\n    - **`.chat`** `function` – a function that sets colors of chat titles\n    - **`.user`** `function` – a function that sets colors of user names\n    - **`.type`** `function` – a function that sets colors of message types\n\n## Contribute\n\nPRs accepted.\n\n## License\n\n[MIT](LICENSE) © [Dmytro Meleshko](https://github.com/dmitmel)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitmel%2Ftelegraf-update-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmitmel%2Ftelegraf-update-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitmel%2Ftelegraf-update-logger/lists"}