{"id":23653357,"url":"https://github.com/dead8309/markitdown-ts","last_synced_at":"2026-01-29T20:00:21.273Z","repository":{"id":269728891,"uuid":"907692189","full_name":"dead8309/markitdown-ts","owner":"dead8309","description":"Convert various file formats to Markdown for indexing, text analysis, and other applications that benefit from structured text. TS port of the python ibrary.","archived":false,"fork":false,"pushed_at":"2025-11-27T07:43:19.000Z","size":5850,"stargazers_count":78,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-30T01:35:13.933Z","etag":null,"topics":["atom","bing","csv","docx","gif","html","jpg","mp3","pdf","png","pptx","rss","typescript","typescript-library","wav","xlsx","xml","zip"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/markitdown-ts","language":"HTML","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/dead8309.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,"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":"2024-12-24T06:56:24.000Z","updated_at":"2025-11-27T07:50:38.000Z","dependencies_parsed_at":"2025-09-01T04:32:12.723Z","dependency_job_id":"d751e90d-c0bb-4be0-8787-54b788828199","html_url":"https://github.com/dead8309/markitdown-ts","commit_stats":null,"previous_names":["dead8309/markitdown-ts"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/dead8309/markitdown-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dead8309%2Fmarkitdown-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dead8309%2Fmarkitdown-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dead8309%2Fmarkitdown-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dead8309%2Fmarkitdown-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dead8309","download_url":"https://codeload.github.com/dead8309/markitdown-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dead8309%2Fmarkitdown-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28883960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T19:55:09.949Z","status":"ssl_error","status_checked_at":"2026-01-29T19:55:08.490Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["atom","bing","csv","docx","gif","html","jpg","mp3","pdf","png","pptx","rss","typescript","typescript-library","wav","xlsx","xml","zip"],"created_at":"2024-12-28T17:53:12.894Z","updated_at":"2026-01-29T20:00:21.259Z","avatar_url":"https://github.com/dead8309.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markitdown-ts\n\n[![CI](https://github.com/dead8309/markitdown-ts/actions/workflows/ci.yml/badge.svg)](https://github.com/dead8309/markitdown/actions/workflows/ci.yml)\n\n`markitdown-ts` is a TypeScript library designed for converting various file formats to Markdown. It can process fiiles from local paths, URLs, or directly from in-memory buffers, making it ideal for serverless and edge environments like Supabase Functions or Cloudflare Workers.\n\nIt is a TypeScript implementation of the original `markitdown` [Python library.](https://github.com/microsoft/markitdown) and is suitable for indexing, text analysis, and other applications that benefit from structured text.\n\nIt supports:\n\n- [x] PDF\n- [x] Word (.docx)\n- [x] Excel (.xlsx)\n- [x] Images (EXIF metadata extraction and optional LLM-based description)\n- [x] Audio (EXIF metadata extraction only)\n- [x] HTML\n- [x] Text-based formats (plain text, .csv, .xml, .rss, .atom)\n- [x] Jupyter Notebooks (.ipynb)\n- [x] Bing Search Result Pages (SERP)\n- [x] ZIP files (recursively iterates over contents)\n- [ ] PowerPoint\n\n\u003e [!NOTE]\n\u003e\n\u003e Speech Recognition for audio converter has not been implemented yet. I'm happy to accept contributions for this feature.\n\n## Installation\n\nInstall `markitdown-ts` using your preferred package manager:\n\n```bash\npnpm add markitdown-ts\n```\n\n## Usage\n\n### Basic Usage (from a File Path)\n\nThe simplest way to use the library is by providing a local file path or a URL.\n\n```typescript\nimport { MarkItDown } from \"markitdown-ts\";\n\nconst markitdown = new MarkItDown();\ntry {\n  // Convert a local file\n  const result = await markitdown.convert(\"path/to/your/file.pdf\");\n\n  // Or convert from a URL\n  const result = await markitdown.convert(\"https://arxiv.org/pdf/2308.08155v2.pdf\");\n\n  if (result) {\n    console.log(result.markdown);\n  }\n} catch (error) {\n  console.error(\"Conversion failed:\", error);\n}\n```\n\n### Advanced Usage (from Buffers, Blobs, or Responses)\n\nFor use in serverless environments where you can't rely on a persistent filesystem, you can convert data directly from memory.\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e This is the recommended approach for environments like **Supabase Edge Functions**, **Cloudflare Workers**, or **AWS Lambda**.\n\n#### From a Buffer\n\nIf you have your file content in a `Buffer`, use the `convertBuffer` method. You **must** provide the `file_extension` in the options so the library knows which converter to use.\n\n```typescript\nimport { MarkItDown } from \"markitdown-ts\";\nimport * as fs from \"fs\";\n\nconst markitdown = new MarkItDown();\ntry {\n  const buffer = fs.readFileSync(\"path/to/your/file.docx\");\n  const result = await markitdown.convertBuffer(buffer, {\n    file_extension: \".docx\"\n  });\n  console.log(result?.text_content);\n} catch (error) {\n  console.error(\"Conversion failed:\", error);\n}\n```\n\n#### From a Response or Blob\n\nYou can pass a standard `Response` object directly to the `convert` method. This is perfect for handling file uploads from a request body.\n\n```typescript\nimport { MarkItDown } from \"markitdown-ts\";\n\nconst markitdown = new MarkItDown();\n\n// Example: Simulating a file upload by creating a Blob and a Response\nconst buffer = fs.readFileSync(\"path/to/archive.zip\");\nconst blob = new Blob([buffer]);\nconst response = new Response(blob, {\n  headers: { \"Content-Type\": \"application/zip\" }\n});\n\ntry {\n  const result = await markitdown.convert(response);\n  console.log(result?.text_content);\n} catch (error) {\n  console.error(\"Conversion failed:\", error);\n}\n```\n\n## YouTube Transcript Support\n\nWhen converting YouTube files, you can pass the `enableYoutubeTranscript` and the `youtubeTranscriptLanguage` option to control the transcript extraction. By default it will use `\"en\"` if the `youtubeTranscriptLanguage` is not provided.\n\n```typescript\nconst markitdown = new MarkItDown();\nconst result = await markitdown.convert(\"https://www.youtube.com/watch?v=V2qZ_lgxTzg\", {\n  enableYoutubeTranscript: true,\n  youtubeTranscriptLanguage: \"en\"\n});\n```\n\n## LLM Image Description Support\n\nTo enable LLM functionality, you need to configure a model and client in the `options` for the image converter. You can use the `@ai-sdk/openai` to get an LLM client.\n\n```typescript\nimport { openai } from \"@ai-sdk/openai\";\n\nconst markitdown = new MarkItDown();\nconst result = await markitdown.convert(\"test.jpg\", {\n  llmModel: openai(\"gpt-4o-mini\"),\n  llmPrompt: \"Write a detailed description of this image\"\n});\n```\n\n## API\n\nThe library exposes a `MarkItDown` class with two primary conversion methods.\n\n```typescript\nclass MarkItDown {\n  /**\n   * Converts a source from a file path, URL, or Response object.\n   */\n  async convert(source: string | Response, options?: ConverterOptions): Promise\u003cConverterResult\u003e;\n\n  /**\n   * Converts a source from an in-memory Buffer.\n   */\n  async convertBuffer(\n    source: Buffer,\n    options: ConverterOptions \u0026 { file_extension: string }\n  ): Promise\u003cConverterResult\u003e;\n}\n\nexport type ConverterResult =\n  | {\n      title: string | null;\n      markdown: string;\n      /** @deprecated Use `markdown` instead. */\n      text_content: string;\n    }\n  | null\n  | undefined;\n\nexport type ConverterOption = {\n  // Required when using convertBuffer\n  file_extension?: string;\n\n  // For URL-based converters (e.g., Wikipedia, Bing SERP)\n  url?: string;\n\n  // Provide a custom fetch implementation\n  fetch?: typeof fetch;\n\n  // YouTube-specific options\n  enableYoutubeTranscript?: boolean; // Default: false\n  youtubeTranscriptLanguage?: string; // Default: \"en\"\n\n  // Image-specific LLM options\n  llmModel?: LanguageModel;\n  llmPrompt?: string;\n\n  // Options for .docx conversion (passed to mammoth.js)\n  styleMap?: string | Array\u003cstring\u003e;\n\n  // Options for .zip conversion\n  cleanupExtracted?: boolean; // Default: true\n};\n```\n\n## Examples\n\nCheck out the [examples](./examples) folder.\n\n## License\n\nMIT License © 2024 [Vaibhav Raj](https://github.com/dead8309)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdead8309%2Fmarkitdown-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdead8309%2Fmarkitdown-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdead8309%2Fmarkitdown-ts/lists"}