{"id":29945240,"url":"https://github.com/matttproud/mdreflink","last_synced_at":"2026-05-18T07:34:42.546Z","repository":{"id":307834043,"uuid":"1027369630","full_name":"matttproud/mdreflink","owner":"matttproud","description":"mdreflink rewrites Markdown files to use reference-style links.","archived":false,"fork":false,"pushed_at":"2025-12-08T09:32:13.000Z","size":599,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-10T18:53:32.168Z","etag":null,"topics":["markdown","markdown-converter","markdown-lang","markdown-language","markdown-parser"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matttproud.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-27T22:06:13.000Z","updated_at":"2025-09-25T14:20:55.000Z","dependencies_parsed_at":"2025-10-01T05:30:29.705Z","dependency_job_id":null,"html_url":"https://github.com/matttproud/mdreflink","commit_stats":null,"previous_names":["matttproud/mdreflink"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/matttproud/mdreflink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fmdreflink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fmdreflink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fmdreflink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fmdreflink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matttproud","download_url":"https://codeload.github.com/matttproud/mdreflink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fmdreflink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33169339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["markdown","markdown-converter","markdown-lang","markdown-language","markdown-parser"],"created_at":"2025-08-03T05:01:09.267Z","updated_at":"2026-05-18T07:34:42.534Z","avatar_url":"https://github.com/matttproud.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MDREFLINK\n\nmdreflink rewrites Markdown files to use reference-style links. It finds all\ninline links, such as `[text](href)`, and converts them to the shortcut\nreference format, `[text]`.\n\nA link's definition is placed at the end of the first section in which the\nlink's link text appears. Definitions are collected, de-duplicated, and sorted\nlexicographically by their link text within their respective sections.\n\nThe program is a command-line tool that reads from standard input or a file\nand writes to standard output or back to the source file.\n\n## Installation\n\nInstall [globally] using [npm]:\n\n```bash\nnpm install -g mdreflink\n```\n\nOr run directly without npm installation using [npx]:\n\n```bash\nnpx mdreflink document.md\n```\n\nThis [npx] approach is beneficial when you want to use `mdreflink`\noccasionally without permanently installing it on your system, or when you\nwant to ensure you're always using the latest version without managing\nupdates manually.\n\n[globally]: https://docs.npmjs.com/downloading-and-installing-packages-globally\n[npm]: https://docs.npmjs.com/\n[npx]: https://docs.npmjs.com/cli/v10/commands/npx\n\n## Usage\n\nThe `mdreflink` tool operates in several modes.\n\n**Read from a file, write to standard output:**\\\nProvide a file path as an argument. The formatted content is written to\nstdout.\n\n```bash\nmdreflink document.md \u003e formatted.md\n```\n\n**Read from standard input, write to standard output:**\\\nIf no file path is given, or if the path is `-`, the program reads from\nstdin.\n\n```bash\nmdreflink \u003c document.md \u003e formatted.md\n```\n\n**Modify a file in-place:**\\\nThe `-w` flag instructs the program to modify the Markdown file directly.\n\n```bash\nmdreflink -w document.md\n```\n\n**Note:** The in-place flag is invalid when reading from standard input.\n\n## Developer and Maintainer Instructions\n\nNote that I am not a fluent JavaScript or TypeScript developer, so I am\nproviding this mostly for posterity for myself. This was probably my deepest\nforay into that ecosystem for a project.\n\n### Notes\n\nThis tool was initially developed through — drum roll — vibe coding the initial\nproject specification and heavily hand iterating on the output. It taught me\na lot about a complex and ornate ecosystem that I otherwise knew little about.\n\nThis was my first time really vibe coding a project. If you see something\ncurious or suboptimal, please flag it. At this point, will be developing this\nexclusively by hand.\n\n[![CI](https://github.com/matttproud/mdreflink/actions/workflows/ci.yml/badge.svg)](https://github.com/matttproud/mdreflink/actions/workflows/ci.yml)\n[![Security](https://github.com/matttproud/mdreflink/actions/workflows/security.yml/badge.svg)](https://github.com/matttproud/mdreflink/actions/workflows/security.yml)\n[![Cross-Platform](https://github.com/matttproud/mdreflink/actions/workflows/compatibility.yml/badge.svg)](https://github.com/matttproud/mdreflink/actions/workflows/compatibility.yml)\n[![Package Health](https://github.com/matttproud/mdreflink/actions/workflows/package-check.yml/badge.svg)](https://github.com/matttproud/mdreflink/actions/workflows/package-check.yml)\n\n[![npm version](https://badge.fury.io/js/mdreflink.svg)](https://badge.fury.io/js/mdreflink)\n[![npm downloads](https://img.shields.io/npm/dm/mdreflink.svg)](https://www.npmjs.com/package/mdreflink)\n[![Node.js Version](https://img.shields.io/node/v/mdreflink)](https://nodejs.org/)\n\n[![codecov](https://codecov.io/gh/matttproud/mdreflink/branch/main/graph/badge.svg)](https://codecov.io/gh/matttproud/mdreflink)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n### Development Setup\n\nA Node.js environment is required for development. After cloning the\nrepository, install the project dependencies:\n\n```bash\nnpm install\n```\n\nThis command installs libraries necessary for TypeScript compilation,\ncode execution, and testing.\n\n### Building\n\nTo compile the TypeScript source code into JavaScript, run the build\nscript:\n\n```bash\nnpm run build\n```\n\nThis command uses the TypeScript compiler (tsc) to transpile the source\nfiles from `src/` into the `dist/` directory, as specified in\n`tsconfig.json`, and then uses esbuild to bundle the sources and transitive\ndependencies into a CLI executable.\n\n### Testing\n\nTo run the general test suite:\n\n```bash\nnpm test\n```\n\nTo update the test golden files (\"snapshots\"):\n\n```bash\nnpm run test:update\n```\n\nSmoke testing can be achieved with:\n\n```bash\nnpm test test:e2e\n```\n\nTo run tests with coverage reporting:\n\n```bash\nnpm run coverage\n```\n\n### Developer Workflows\n\nFor local development, after building, you can link the package to make\nthe `mdreflink` command available globally:\n\n```bash\nnpm link\n```\n\n```bash\nmdreflink document.md\n```\n\nTo uninstall the global link:\n\n```bash\nnpm unlink -g mdreflink\n```\n\nFor local development without npm link, you can also run directly:\n\n```bash\nnode dist/index.js document.md \u003e formatted.md\n```\n\n### Package Validation\n\nTo validate the package configuration before publishing:\n\n```bash\nnpm run lint:package\n```\n\nThis runs [publint] to check for common packaging issues.\n\nTo preview what will be published:\n\n```bash\nnpm pack\n```\n\nThis creates a tarball showing exactly what files will be included in the\npublished package. Remember to clean up the generated .tgz file\nafterward.\n\n[publint]: https://publint.dev/\n\n### Release Tagging\n\nThis project uses automated releases triggered by Git tags. Tags must follow the `v{version}` format (e.g., `v1.2.3`) to match JavaScript ecosystem conventions.\n\n**To create a new release:**\n\n1. Update the version in `package.json`:\n\n   ```bash\n   npm version patch  # or minor, major\n   ```\n\n2. Create an annotated tag with release notes:\n\n   ```bash\n   git tag -a v1.2.3 -m \"Release v1.2.3\n\n   - Add feature X\n   - Fix bug Y\n   - Update dependencies\"\n   ```\n\n3. Push the tag to trigger automated release:\n   ```bash\n   git push origin v1.2.3\n   ```\n\nThe GitHub Actions workflow will automatically:\n\n* Run all tests (unit and e2e)\n* Validate the package\n* Publish to npm with provenance\n* Create a GitHub release\n\n**Note:** The tag version (without 'v' prefix) must exactly match the version in `package.json` or the release will fail.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatttproud%2Fmdreflink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatttproud%2Fmdreflink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatttproud%2Fmdreflink/lists"}