{"id":18535287,"url":"https://github.com/tinyhttp/markdown","last_synced_at":"2025-04-09T15:32:03.710Z","repository":{"id":57166681,"uuid":"384728721","full_name":"tinyhttp/markdown","owner":"tinyhttp","description":"🗒 Static markdown middleware for Node.js.","archived":false,"fork":false,"pushed_at":"2023-10-26T16:05:13.000Z","size":155,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T08:47:03.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tinyhttp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["tinyhttp","talentlessguy"],"issuehunt":"talentlessguy"}},"created_at":"2021-07-10T15:21:26.000Z","updated_at":"2023-08-13T15:49:35.000Z","dependencies_parsed_at":"2022-08-30T15:21:33.859Z","dependency_job_id":"5779797b-e30a-4e03-b5bf-e9bf4787b6b8","html_url":"https://github.com/tinyhttp/markdown","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"tinyhttp/repo-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyhttp%2Fmarkdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyhttp%2Fmarkdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyhttp%2Fmarkdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyhttp%2Fmarkdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinyhttp","download_url":"https://codeload.github.com/tinyhttp/markdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248058078,"owners_count":21040691,"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":[],"created_at":"2024-11-06T19:21:48.201Z","updated_at":"2025-04-09T15:32:03.705Z","avatar_url":"https://github.com/tinyhttp.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n\n# @tinyhttp/markdown\n\n[![npm][npm-img]][npm-url] [![GitHub Workflow Status][gh-actions-img]][github-actions] [![Coverage][cov-img]][cov-url]\n\n\u003c/div\u003e\n\nStatic markdown middleware for Node.js.\n\n## Install\n\n```sh\npnpm i @tinyhttp/markdown\n```\n\n## API\n\n### `markdownStaticHandler(dir, options)`\n\nHandles static files and transforms markdown in HTML in a specified directory. It tries to assign root to `README.md` or `index.md` (and with `.markdown` extension too) in case any of them exists.\n\n#### Options\n\n- `prefix` - URL prefix to add to routes and remove from file paths\n- `stripExtension` - remove `.md` (or `.markdown`) extension from markdown files. Enabled by defaults.\n- `markedOptions` - initial [marked](https://github.com/markedjs/marked) options to be used by the handler.\n- `caching` settings for `Cache-Control` header. Disabled by default.\n\n## Example\n\n```ts\nimport { App } from '@tinyhttp/app'\nimport { markdownStaticHandler as md } from '@tinyhttp/markdown'\n\nnew App()\n  .use(\n    md('docs', {\n      prefix: '/docs',\n      stripExtension: true,\n      markedExtensions: [{ headerIds: true }]\n    })\n  )\n  .listen(3000)\n```\n\n[npm-url]: https://npmjs.com/package/@tinyhttp/markdown\n[github-actions]: https://github.com/tinyhttp/markdown/actions\n[gh-actions-img]: https://img.shields.io/github/actions/workflow/status/tinyhttp/markdown/ci.yml?style=for-the-badge\u0026logo=github\u0026label=\u0026color=hotpink\n[cov-img]: https://img.shields.io/coveralls/github/tinyhttp/markdown?style=for-the-badge\u0026color=hotpink\n[cov-url]: https://coveralls.io/github/tinyhttp/markdown\n[npm-img]: https://img.shields.io/npm/dt/@tinyhttp/markdown?style=for-the-badge\u0026color=hotpink\n","funding_links":["https://github.com/sponsors/tinyhttp","https://github.com/sponsors/talentlessguy","https://issuehunt.io/r/talentlessguy"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyhttp%2Fmarkdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinyhttp%2Fmarkdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyhttp%2Fmarkdown/lists"}