$ show flowershow/markdowndb
MarkdownDB is a JavaScript library and CLI tool that parses markdown files to extract structured data (frontmatter, tags, links, tasks) and stores it in a queryable SQLite database (or JSON files). It provides a lightweight Node.js API for querying the indexed data and includes a command-line tool for indexing folders and executing scripts. The architecture follows a modular design with clear separation between markdown parsing, processing, storage, and querying layers. The system uses remark-family tools for markdown parsing, Knex.js for database operations, and Zod for schema validation. Key entry points are the CLI (`src/bin/index.js`) and Node.js API (`src/index.ts`).
The LLM identified 3 files worth highlighting for reuse:
Handles markdown input from various sources (string, buffer, stream, ArrayBuffer) with proper encoding/decoding. Normalizes inputs to UTF-8 strings and delegates to shared parsing logic. Demonstrates skill in handling multiple input types uniformly while maintaining clean separation of concerns.
Core markdown parsing logic that extracts frontmatter (via gray-matter), tags from body content, wiki-style links, and tasks. Uses remark-parse with plugins for GFM and wiki link support. Shows non-obvious skill in extracting diverse markdown features while maintaining clean separation between parsing and data extraction.
Provides database adapter utilities for cross-database compatibility (SQLite, MySQL, PostgreSQL). Handles SQL dialect differences for JSON operations, LIKE queries, and null checks in a clean, reusable way. Demonstrates expertise in abstracting database-specific syntax while maintaining a consistent API.