pipr.tools
Pipes
Clean Email Strip formatting from pasted email for clean plain text Clean AI Output Clean plain text from ChatGPT or AI output Decode & Format JWT Decode a JWT and pretty-print header and payload Word Frequency Count word frequency in text

csv-to-md-table Convert CSV to GitHub-flavored Markdown table

⟐ Data
Input0 chars
Output0 chars

Examples

Convert CSV to a GitHub-flavored Markdown table

Usage
"name,role,city
Alice,admin,Paris
Bob,editor,London" | csv-to-md-table

Create a Markdown table for a GitHub README or PR

Usage
"Feature,Status,Owner
Auth,Done,Alice
Dashboard,In Progress,B..." | csv-to-md-table

Format comparison data as a Markdown table for a blog post

Usage
"Tool,Category,Use Case
slugify,Text,URL generation
json-form..." | csv-to-md-table
View source
(input)=>{
                const lines = input.trim().split("\n");
                if (!lines.length) return "";
                const delim = lines[0].includes("\t") ? "\t" : ",";
                const rows = lines.map((l)=>l.split(delim).map((c)=>c.trim()));
                const fmt = (row)=>`| ${row.join(" | ")} |`;
                const sep = `| ${rows[0].map(()=>"---").join(" | ")} |`;
                return [
                    fmt(rows[0]),
                    sep,
                    ...rows.slice(1).map(fmt)
                ].join("\n");
            }

Also useful for