{"id":31956349,"url":"https://github.com/profullstack/document-converters","last_synced_at":"2026-03-01T07:31:39.809Z","repository":{"id":292679872,"uuid":"981597049","full_name":"profullstack/document-converters","owner":"profullstack","description":"A simple, unified API for converting between various document formats.","archived":false,"fork":false,"pushed_at":"2025-05-15T09:02:15.000Z","size":135,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-23T19:52:03.536Z","etag":null,"topics":["convert","document","docx","pdf","xlsx"],"latest_commit_sha":null,"homepage":"https://convert2doc.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/profullstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-05-11T13:23:27.000Z","updated_at":"2025-05-15T09:02:18.000Z","dependencies_parsed_at":"2025-05-11T15:19:00.950Z","dependency_job_id":"d99c43d1-0990-4075-885b-4a53eca31064","html_url":"https://github.com/profullstack/document-converters","commit_stats":null,"previous_names":["profullstack/document-converters"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/profullstack/document-converters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fdocument-converters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fdocument-converters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fdocument-converters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fdocument-converters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/profullstack","download_url":"https://codeload.github.com/profullstack/document-converters/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fdocument-converters/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29963742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T06:55:38.174Z","status":"ssl_error","status_checked_at":"2026-03-01T06:53:04.810Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["convert","document","docx","pdf","xlsx"],"created_at":"2025-10-14T14:48:36.768Z","updated_at":"2026-03-01T07:31:39.789Z","avatar_url":"https://github.com/profullstack.png","language":"JavaScript","readme":"# @profullstack/document-converters\n\nA simple, unified API for converting between various document formats.\n\n## Features\n\n- Convert HTML to PDF\n- Convert HTML to Word documents (.docx)\n- Convert HTML to Excel spreadsheets (.xlsx)\n- Convert HTML to PowerPoint presentations (.pptx)\n- Convert HTML to EPUB e-books\n- Convert between HTML and Markdown\n- Simple, promise-based API\n- Fallback mechanisms for different environments\n- Comprehensive options for fine-tuning conversions\n\n## Installation\n\n```bash\nnpm install @profullstack/document-converters\n```\n\n## Basic Usage\n\n```javascript\nimport converters from '@profullstack/document-converters';\n\n// Convert HTML to PDF\nconst pdfBuffer = await converters.htmlToPdf('\u003ch1\u003eHello World\u003c/h1\u003e');\n\n// Convert HTML to Word document\nconst docBuffer = await converters.htmlToDoc('\u003ch1\u003eHello World\u003c/h1\u003e');\n\n// Convert HTML to Markdown\nconst markdown = await converters.htmlToMarkdown('\u003ch1\u003eHello World\u003c/h1\u003e');\n\n// Convert Markdown to HTML\nconst html = await converters.markdownToHtml('# Hello World');\n```\n\n## API Reference\n\n### Main Converter Object\n\nThe main export is a converter object with methods for all supported conversions:\n\n```javascript\nimport converters from '@profullstack/document-converters';\n```\n\n#### HTML to PDF\n\n```javascript\nconst pdfBuffer = await converters.htmlToPdf(html, options);\n```\n\n- `html`: HTML content to convert\n- `options`: PDF generation options (see Puppeteer PDF options)\n  - `format`: Paper format (default: 'A4')\n  - `printBackground`: Whether to print background (default: true)\n  - `margin`: Page margins (default: 1cm on all sides)\n\n#### HTML to Word\n\n```javascript\nconst docBuffer = await converters.htmlToDoc(html, options);\n```\n\n- `html`: HTML content to convert\n- `options`: Word document generation options\n  - `forcePandoc`: Force using pandoc even if docx is available\n  - `forceDocx`: Force using docx library even if pandoc is available\n  - `pandocOptions`: Additional pandoc command line options\n\n#### HTML to Excel\n\n```javascript\nconst excelBuffer = await converters.htmlToExcel(html, options);\n```\n\n- `html`: HTML content to convert (should contain table elements)\n- `options`: Excel generation options\n\n#### HTML to PowerPoint\n\n```javascript\nconst pptBuffer = await converters.htmlToPpt(html, options);\n```\n\n- `html`: HTML content to convert\n- `options`: PowerPoint generation options\n\n#### HTML to EPUB\n\n```javascript\nconst epubBuffer = await converters.htmlToEpub(html, options);\n```\n\n- `html`: HTML content to convert\n- `options`: EPUB generation options\n\n#### HTML to Markdown\n\n```javascript\nconst markdown = await converters.htmlToMarkdown(html, options);\n```\n\n- `html`: HTML content to convert\n- `options`: Markdown generation options\n\n#### Markdown to HTML\n\n```javascript\nconst html = await converters.markdownToHtml(markdown, options);\n```\n\n- `markdown`: Markdown content to convert\n- `options`: HTML generation options\n\n### Individual Converters\n\nFor more advanced usage, you can access the individual converters directly:\n\n```javascript\nimport { pdfConverter, docConverter } from '@profullstack/document-converters';\n\n// Or access them from the main object\nconst { pdf, doc, excel, ppt, epub, markdown } = converters;\n```\n\n#### PDF Converter\n\n```javascript\n// Convert HTML to PDF\nconst pdfBuffer = await pdfConverter.fromHtml(html, options);\n\n// Convert URL to PDF\nconst pdfFromUrl = await pdfConverter.fromUrl('https://example.com', options);\n\n// Convert multiple HTML pages to a single PDF\nconst multiPagePdf = await pdfConverter.fromMultipleHtml([html1, html2], options);\n```\n\n#### Word Document Converter\n\n```javascript\n// Convert HTML to Word document\nconst docBuffer = await docConverter.fromHtml(html, options);\n\n// Convert URL to Word document\nconst docFromUrl = await docConverter.fromUrl('https://example.com', options);\n\n// Convert Markdown to Word document\nconst docFromMarkdown = await docConverter.fromMarkdown(markdown, options);\n```\n\n## Examples\n\nSee the [examples](./examples) directory for complete usage examples.\n\n## Requirements\n\n- Node.js 14.x or higher\n- For PDF conversion: Puppeteer (included as a dependency)\n- For Word document conversion: Either pandoc installed on the system or the docx library (included as a dependency)\n\n## License\n\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofullstack%2Fdocument-converters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprofullstack%2Fdocument-converters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofullstack%2Fdocument-converters/lists"}