Package Exports
- @knowcode/convert-to-markdown
- @knowcode/convert-to-markdown/excel
- @knowcode/convert-to-markdown/pdf
- @knowcode/convert-to-markdown/utils
- @knowcode/convert-to-markdown/word
Readme
Convert to Markdown
Convert Excel, PDF, and Word documents to clean, AI-ready formats like Markdown and JSON.
convert-to-markdown.vercel.app - No signup required!
🌐 Try it now at🌐 Try Our Hosted Service First!
🚀 https://convert-to-markdown.vercel.app/ 🚀
No installation required • Free tier available • Production-ready API
📦 Usage Options
1. Hosted API Service (Recommended)
🔗 https://convert-to-markdown.vercel.app/
- ✅ No setup required - Start converting documents immediately
- ✅ Always up-to-date - Latest features without updating packages
- ✅ Scalable - Handles any volume with auto-scaling
- ✅ Free tier - Perfect for testing and small projects
- ✅ Full API documentation - Interactive examples and guides
# Quick example using the hosted service
curl -X POST https://convert-to-markdown.vercel.app/api/xlsx-converter \
-F "file=@your-file.xlsx" \
-H "Accept: application/json"
2. NPM Package (Self-hosted)
For teams that need to run the converter in their own infrastructure:
npm install @knowcode/convert-to-markdown
const ConvertToMarkdown = require('@knowcode/convert-to-markdown');
// Convert Excel to JSON
const result = await ConvertToMarkdown.excelToJson('data.xlsx');
const data = JSON.parse(result.content);
// Convert PDF to Markdown
const pdfResult = await ConvertToMarkdown.pdfToMarkdown('document.pdf');
console.log(pdfResult.document);
NPM Documentation: docs/npm-usage.md
3. Deploy Your Own API (Google Cloud Functions)
Deploy as serverless API endpoints for HTTP-based document conversion.
# Deploy all functions
./deploy.sh
# Or deploy individually
npm run deploy:xlsx
npm run deploy:pdf
npm run deploy:docx
API Documentation: docs/api.md
🎯 Why Use Our Hosted Service?
The hosted service at convert-to-markdown.vercel.app offers:
- 🚀 Instant Access - No installation, configuration, or deployment needed
- 💰 Free Tier - Perfect for testing and small projects
- 📈 Auto-scaling - Handles traffic spikes automatically
- 🔒 Secure - HTTPS encryption and no data storage
- 🌍 Global CDN - Fast response times worldwide
- 📊 Analytics - Track your usage and conversions
- 🔧 Always Updated - Get new features without updating code
- 📖 Interactive Docs - Test API endpoints directly in the browser
Note: This NPM package provides the same conversion capabilities for teams that need on-premise deployment or custom integrations.
📚 Features
- Excel → JSON/Markdown: Resolves formulas, cleans data, preserves structure
- PDF → Markdown: Extracts text, detects tables, formats headings
- Word → HTML/Markdown: Preserves formatting, converts styles, handles tables
- AI-Ready Output: Token estimates, metadata headers, clean formatting
- Dual Architecture: Use as API or NPM package with same core functionality
🛠️ Local Development
# Install dependencies
npm install
# Run locally as API
npm run start:xlsx # Excel converter on port 8080
npm run start:pdf # PDF converter
npm run start:docx # Word converter
# Test NPM package
npm test
📖 Documentation
- API Documentation - RESTful API usage and examples
- NPM Package Guide - Programmatic usage in Node.js
- Architecture Overview
🏗️ Project Structure
├── lib/ # NPM package core (pure functions)
│ ├── converters/ # Document converters
│ ├── utils/ # Shared utilities
│ └── index.js # NPM entry point
├── src/ # Google Cloud Functions adapters
├── test/ # Test files and samples
└── docs/ # Documentation
📄 License
MIT