{"id":13707997,"url":"https://github.com/adr/adr-log","last_synced_at":"2025-05-06T07:31:23.315Z","repository":{"id":26220349,"uuid":"101301521","full_name":"adr/adr-log","owner":"adr","description":" Generate an architectural decision record log (adr-log) out of architectural decision records (ADRs)","archived":false,"fork":true,"pushed_at":"2023-01-05T19:49:45.000Z","size":126,"stargazers_count":86,"open_issues_count":6,"forks_count":56,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-20T21:35:22.686Z","etag":null,"topics":["architecture-decision-records","architecture-doc","npm-package"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jonschlinkert/markdown-toc","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-08-24T14:04:57.000Z","updated_at":"2025-04-10T15:11:55.000Z","dependencies_parsed_at":"2023-01-16T23:15:32.335Z","dependency_job_id":null,"html_url":"https://github.com/adr/adr-log","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adr%2Fadr-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adr%2Fadr-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adr%2Fadr-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adr%2Fadr-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adr","download_url":"https://codeload.github.com/adr/adr-log/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252640007,"owners_count":21780856,"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","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":["architecture-decision-records","architecture-doc","npm-package"],"created_at":"2024-08-02T22:01:52.547Z","updated_at":"2025-05-06T07:31:22.994Z","avatar_url":"https://github.com/adr.png","language":"JavaScript","funding_links":[],"categories":["others","JavaScript"],"sub_categories":[],"readme":"# adr-log [![NPM version](https://img.shields.io/npm/v/adr-log.svg?style=flat)](https://www.npmjs.com/package/adr-log)\n\n\u003e Generate an architectural decision log out of architectural decision records (ADRs).\n\n## Table of Contents\n\n\u003c!-- toc --\u003e\n\n- [Install](#install)\n- [CLI](#cli)\n- [Usage](#usage)\n  * [Examples](#examples)\n    + [Printing the adr log to stdout](#printing-the-adr-log-to-stdout)\n    + [Generating an index.md file containing the adr log](#generating-an-indexmd-file-containing-the-adr-log)\n- [Developing](#developing)\n- [Related Tooling](#related-tooling)\n- [License](#license)\n\n\u003c!-- tocstop --\u003e\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\nnpm install -g adr-log\n```\n\n## CLI\n\n```text\nUsage: adr-log [-d \u003cdirectory\u003e] [-i \u003cinput\u003e] [-p \u003cpath_prefix\u003e]\n\n  input:  The markdown file to contain the table of contents.\n          If no \u003cinput\u003e file is specified, an index.md file containing the log is created in the current directory.\n\n  -i:     Edit the \u003cinput\u003e file directly, injecting the log at \u003c!-- adrlog --\u003e.\n          Using only the -i flag, the tool will scan the current working directory for all *.md files and\n          inject the resulting adr-log into the default index.md file.\n          (Without this flag, the default is to print the log to stdout.)\n\n  -d:     Scans the given \u003cdirectory\u003e for .md files.\n          (Without this flag, the current working directory is chosen as default.)\n\n  -e      Exclude any files matching the given \u003cpattern\u003e\n\n  -p:     Path prefix for each ADR file path written in log\n          (Default is empty)\n\n  -b      Change the character used to for bullets\n          Supports: asterisk, dash, plus\n          (Default is asterisk)\n\n  -h:     Shows how to use this program\n```\n\n## Usage\n\n### Examples\n\n#### Printing the adr log to stdout\n\nConsider a directory consisting of three files (`0000-example-1.md`, `0001-example-2.md`, `0002-example-3.md`).\nExecute following command:\n\n```sh\nadr-log -d .\n```\n\nThis outputs following log on your console:\n\n```markdown\n* [ADR-0000](0000-example-1.md) - Example 1\n* [ADR-0001](0001-example-2.md) - Example 2\n* [ADR-0002](0002-example-3.md) - Example 3\n```\n\n#### Generating an index.md file containing the adr log\n\nSince this is basically a fork of [Jon Schlinkert's](https://github.com/jonschlinkert) [markdown-toc](https://github.com/jonschlinkert/markdown-toc), you can also choose to insert the log into an existing file.\nFor this to work the file must contain an opening `\u003c!-- adrlog --\u003e` code comment, after which the log will be inserted.\n\nIf the file already contains an adrlog surrounded by an opening `\u003c!-- adrlog --\u003e` and closing `\u003c!-- adrlogstop --\u003e` code comment, the existing is be replaced.\n\nUsing `-i` alone (`adr-log -i`) generates an `index.md` file in the current working directory containing the log.\n\n```sh\n$ adr-log -i\n```\n\nResult in following `index.md`:\n\n```markdown\n\u003c!-- adrlog --\u003e\n\n* [ADR-0000](0000-example-1.md) - Example 1\n* [ADR-0001](0001-example-2.md) - Example 2\n* [ADR-0002](0002-example-3.md) - Example 3\n\n\u003c!-- adrlogstop --\u003e\n```\n\n### Alternative Indexing\n\n- search recursively underneath the given directory\n- allow date prefixes as well as number prefixes\n- allow specification of `index` or `date` properties in frontmatter\n- fallback to auto-numbering for ADRs without filename prefixes or frontmatter\n\n## Developing\n\n- Run `node cli.js` to execute the CLI.\n  Also works with relative directgories.\n  E.g., `node ../../../adr-log/cli.js -d .` runs adr-log and outputs the result to the console.\n- You can turn on debugging output by adjusting lines 6 and 7 in `cli.js`.\n- Use [relase-it](https://www.npmjs.com/package/release-it) and [github-release-from-changelog](https://github.com/MoOx/github-release-from-changelog) for release management.\n  See also [ADR-0003](docs/adr/0003-use-release-it-and-github-release-from-changelog-as-release-tooling.md).\n\n## Related Tooling\n\n[adr-tools](https://github.com/npryce/adr-tools) is the most prominent related tool.\nIt supports generating an ADR log by using `adr generate toc`.\nAn example to can be investigated at \u003chttps://github.com/npryce/adr-tools/blob/master/tests/generate-contents.expected\u003e.\n\nThe difference to adr-tools is\n\n1. adr-log is available using `npm` and thus more easy to install.\n2. adr-tools does not include the heading of each ADR into the output.\n\n## License\n\nCopyright © 2017 [Tino Stadelmaier](https://github.com/tstadelmaier), [Oliver Kopp](https://github.com/koppor), [Armin Hüneburg](https://github.com/hueneburg), [Tobias Wältken](https://github.com/mee4895).\n\nReleased under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadr%2Fadr-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadr%2Fadr-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadr%2Fadr-log/lists"}