{"id":15435893,"url":"https://github.com/uetchy/mdmod","last_synced_at":"2026-05-14T21:32:27.496Z","repository":{"id":57293639,"uuid":"282833040","full_name":"uetchy/mdmod","owner":"uetchy","description":"✂️🧬 Powerful \u0026 extensible Markdown fragment editor","archived":false,"fork":false,"pushed_at":"2021-11-09T06:57:19.000Z","size":317,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-02T07:57:51.545Z","etag":null,"topics":["cli","markdown","mdmod","readme"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uetchy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["uetchy"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-07-27T08:04:52.000Z","updated_at":"2021-11-09T06:57:22.000Z","dependencies_parsed_at":"2022-09-01T06:40:19.847Z","dependency_job_id":null,"html_url":"https://github.com/uetchy/mdmod","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/uetchy/mdmod","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2Fmdmod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2Fmdmod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2Fmdmod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2Fmdmod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uetchy","download_url":"https://codeload.github.com/uetchy/mdmod/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2Fmdmod/sbom","scorecard":{"id":907152,"data":{"date":"2025-08-11","repo":{"name":"github.com/uetchy/mdmod","commit":"97e76b5567f39784cabdcd362e8bc99a2a52a68f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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/test.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/uetchy/mdmod/test.yml/master?enable=pin","Info:   0 out of   1 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml: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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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":"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"}}]},"last_synced_at":"2025-08-24T17:45:23.972Z","repository_id":57293639,"created_at":"2025-08-24T17:45:23.972Z","updated_at":"2025-08-24T17:45:23.972Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017157,"owners_count":26085983,"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-10-13T02:00:06.723Z","response_time":61,"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":["cli","markdown","mdmod","readme"],"created_at":"2024-10-01T18:46:47.847Z","updated_at":"2025-10-13T22:12:22.215Z","avatar_url":"https://github.com/uetchy.png","language":"TypeScript","funding_links":["https://github.com/sponsors/uetchy"],"categories":[],"sub_categories":[],"readme":"# mdmod\n\n[![npm-version]][npm-url]\n[![npm-downloads]][npm-url]\n[![Actions Status: test](https://github.com/uetchy/mdmod/workflows/test/badge.svg)](https://github.com/uetchy/mdmod/actions?query=test)\n\n[npm-version]: https://badgen.net/npm/v/mdmod\n[npm-downloads]: https://badgen.net/npm/dt/mdmod\n[npm-url]: https://npmjs.org/package/mdmod\n\n\u003e Powerful \u0026 extensible Markdown fragment editor.\n\n## Features\n\n- Programmatically update portion of Markdown document (Table of Contents, package index for Monorepo, version number in the installation guide, etc)\n- [Plugins](#official-plugins) to extend its usage\n\n## Install\n\n```bash\nnpm i -g mdmod\n```\n\n## Use case - update version string in the installation guide\n\nSuppose we are about to update the README.md for the latest version `v6.0.0`.\n\nDefine a block starting with `\u003c!-- START mdmod --\u003e` and with a trailing `\u003c!-- END mdmod --\u003e`, and then pass the option as an object, where `match` is `/v\\d\\.\\d\\.\\d/g` and `replace` is `version`.\n\n````md\n\u003c!-- START mdmod {match: /v\\d\\.\\d\\.\\d/g, replace: version} --\u003e\n\n```\ncurl https://path/to/releases/v0.4.0.tar.gz\ntar -zxvf v0.4.0.tar.gz\n```\n\n\u003c!-- END mdmod --\u003e\n````\n\nRun `mdmod` with a variable `version` set `v6.0.0`:\n\n```bash\nmdmod README.md --define.version v6.0.0\n```\n\nThis will replace all the string matched `/v\\d\\.\\d\\.\\d/` with the content of `version` defined in the CLI argument:\n\n````md\n\u003c!-- START mdmod {match: /v\\d\\.\\d\\.\\d/g, replace: version} --\u003e\n\n```\ncurl https://path/to/releases/v6.0.0.tar.gz\ntar -zxvf v6.0.0.tar.gz\n```\n\n\u003c!-- END mdmod --\u003e\n````\n\n## Configuration\n\n### MdmodOption\n\n```ts\n{\n  replace: (() =\u003e string) | string,\n  match?: RegExp,\n  use?: string | [string, string]\n}\n```\n\n- **replace**: function or variable or string literal to replace with\n- **match** (optional): regular expression to match text. Without `match`, mdmod will replace whole text.\n- **use** (optional): specify plugin to use. If `use` property is given, other options will be ignored. If relative path is given (e.g. `use: \"./scripts/contributors.js\"`), use the specified script as a plugin. You can pass args to a plugin like this: `use: [\"somePlugin\", {foo: \"bar\"}]`\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to write a plugin.\n\n### Start of block\n\n```\n\u003c!-- START mdmod MdmodOption --\u003e\n\u003c!-- START mdmod [MdmodOption, MdmodOption, ...] --\u003e\n```\n\n### End of block\n\n```\n\u003c!-- END mdmod --\u003e\n```\n\n### Environment variable\n\nInstead of using `--define.\u003ckey\u003e=\u003cvalue\u003e`, you can also define a variable with exporting environment variable `MDMOD_\u003ckey\u003e`. `\u003ckey\u003e` will be lowercased and added to the VM's constant dictionary.\n\n## Official Plugins\n\n### Table of Contents ([`mdmod-plugin-toc`](https://github.com/uetchy/mdmod-plugin-toc))\n\nGenerate a table of contents.\n\n```bash\nnpm i -g mdmod-plugin-toc\nmdmod README.md\n```\n\n```\n\u003c!-- START mdmod {use: 'toc'} --\u003e\n\u003c!-- END mdmod --\u003e\n```\n\nwould produce:\n\n```md\n- [mdmod](#mdmod)\n  - [Features](#features)\n  - [Install](#install)\n  - [Example Usage](#example-usage)\n  - [Configuration](#configuration)\n    - [MdmodOption](#mdmodoption)\n    - [Start of block](#start-of-block)\n    - [End of block](#end-of-block)\n    - [Environment variable](#environment-variable)\n  - [Official Plugins](#official-plugins)\n    - [Table of Contents (`mdmod-plugin-toc`)](#table-of-contents-mdmod-plugin-toc)\n    - [Table of Packages (`mdmod-plugin-top`)](#table-of-packages-mdmod-plugin-top)\n  - [Usage Tips](#usage-tips)\n    - [Sync version text in README.md with the latest `git tag`](#sync-version-text-in-readmemd-with-the-latest-git-tag)\n    - [Automated workflow with `husky` and `lint-staged`](#automated-workflow-with-husky-and-lint-staged)\n```\n\n### Table of Packages ([`mdmod-plugin-top`](https://github.com/uetchy/mdmod-plugin-top))\n\nGenerate a list of monorepo packages (`/packages/*`).\n\n```bash\nnpm i -g mdmod-plugin-top\nmdmod README.md\n```\n\n```\n\u003c!-- START mdmod {use: 'top'} --\u003e\n\u003c!-- END mdmod --\u003e\n```\n\nwould produce:\n\n````md\n### [pkg1](packages/pkg1)\n\ntestPackage\n\n[![](https://img.shields.io/npm/v/pkg1.svg)](https://npmjs.com/package/pkg1)\n[![npm: total downloads](https://flat.badgen.net/npm/dt/pkg1)](https://npmjs.com/package/pkg1)\n![npm: license](https://flat.badgen.net/npm/license/pkg1)\n\n```bash\nnpm install --save pkg1\n# or\nyarn add pkg1\n```\n````\n\n### GitHub Sponsors ([`mdmod-plugin-github-sponsors`](https://github.com/uetchy/mdmod-plugin-github-sponsors))\n\n```bash\nnpm i -g mdmod-plugin-github-sponsors\nmdmod README.md --define.owner uetchy\n```\n\n```\n# Sponsors\n\n\u003c!-- START mdmod {use: 'github-sponsors'} --\u003e\n\u003c!-- END mdmod --\u003e\n```\n\nwould produce:\n\n```md\n# Sponsors\n\n\u003c!-- START mdmod {use: 'github-sponsors'} --\u003e\n\n[\u003cimg src=\"https://avatars.githubusercontent.com/u/6936373?u=4edd14e6636c45d10ac6a3eecb4b3ffa6cc2bf5c\u0026v=4\" width=\"35\" /\u003e](https://github.com/Naturalclar) [\u003cimg src=\"https://avatars.githubusercontent.com/u/79023920?v=4\" width=\"35\" /\u003e](https://github.com/Lierin8oracle)\n\n\u003c!-- END mdmod --\u003e\n```\n\n## Usage Tips\n\n### Sync version text in README.md with the latest `git tag`\n\n```bash\nnpx mdmod README.md --define.version $(git describe --tags --match 'v*' --abbrev=0)\n```\n\n`README.md`:\n\n````md\n# Download\n\n\u003c!-- START mdmod {match: /v\\d\\.\\d\\.\\d/g, replace: version} --\u003e\n\n```bash\ncurl -LO https://github.com/uetchy/mdmod/archive/v0.4.0.zip\nunzip v0.4.0.zip\n```\n\n\u003c!-- END mdmod --\u003e\n````\n\n### Automated workflow with `husky` and `lint-staged`\n\n```json\n{\n  \"husky\": {\n    \"pre-commit\": \"lint-staged\"\n  },\n  \"lint-staged\": {\n    \"*.md\": [\"mdmod\"]\n  }\n}\n```\n\n## Showcase\n\nList of awesome projects that use mdmod.\n\n- [Tencent/cloudbase-framework](https://github.com/Tencent/cloudbase-framework)\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuetchy%2Fmdmod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuetchy%2Fmdmod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuetchy%2Fmdmod/lists"}