Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

csv-to-markdown-table

Latest version: v2.1.0

Overview

Last scanned
30 Nov 2026
Published
30 Nov 2026
npm package Publisher: donatj
303 Stars
47 Forks
2 Versions
153.8K Downloads
TypeScript Repo language

Scan summary

csv-to-markdown-table was last scanned on 30 Nov 2026 at version 2.1.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions; the latest was published on 30 Nov 2026.
  • Findings: No rules fired in version 2.1.0.
  • Downloads: 153,762 downloads.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
2.1.0 LATEST 30 Nov 2026 No rules fired
2.0.0 10 Sep 2026 No rules fired

No rules fired in 2.1.0

Findings

Findings for v2.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 2.1.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

CSV To Markdown Table

npm GitHub license

Simple JavaScript CSV to Markdown Table Converter

You can see it in action and play with the Live Example.

Uses csv-walker for CSV parsing. Works in Node.js (>=20) as well as in the browser.

Install

npm install csv-to-markdown-table

Usage

CLI

This package also includes a CLI tool. You can install it globally with:

npm install -g csv-to-markdown-table

Then you can use it like so:

$ csv-to-markdown-table --help
Usage: csv-to-markdown-table [options]
// … help output

$ csv-to-markdown-table --delim ',' --headers < example.csv
| cats | dogs | fish | 
|------|------|------|
| 1    | 2    | 3    | 
| 4    | 5    | 6    |
$ csv-to-markdown-table
Reading from stdin... (press Ctrl+D at the start of a line to finish)
CSV Delimiter: \t (tab) Headers: false
[interactive input]
Browser via CDN (UMD)
<script src="https://unpkg.com/csv-to-markdown-table"></script>
<script>
  console.log(
    csvToMarkdown("Name,Role,Location\nAda Lovelace,Mathematician,London\nGrace Hopper,Computer scientist,New York", ",", true)
  );
</script>
Node.js with CommonJS (require)
const csvToMarkdown = require("csv-to-markdown-table");

console.log(
  csvToMarkdown("Name,Role,Location\nAda Lovelace,Mathematician,London\nGrace Hopper,Computer scientist,New York", ",", true)
);
Node.js with ES Modules (import)
import csvToMarkdown from "csv-to-markdown-table";

console.log(
  csvToMarkdown("Name,Role,Location\nAda Lovelace,Mathematician,London\nGrace Hopper,Computer scientist,New York", ",", true)
);
TypeScript
import csvToMarkdown from "csv-to-markdown-table";

console.log(
  csvToMarkdown("Name,Role,Location\nAda Lovelace,Mathematician,London\nGrace Hopper,Computer scientist,New York", ",", true)
);
Outputs:
| Name         | Role               | Location |
|--------------|--------------------|----------|
| Ada Lovelace | Mathematician      | London   |
| Grace Hopper | Computer scientist | New York |

Which displays in markdown as:

Name Role Location
Ada Lovelace Mathematician London
Grace Hopper Computer scientist New York

Markdown output escapes pipes and backslashes. Column widths include the added backslashes.

Options

The optional fourth argument accepts conversion settings:

csvToMarkdown('name,quote\nAda,"line one\nline two"', ",", true, {
  newlineReplacement: "<br />",
  cellFilter: (value) => value.trim(),
});

enclosure and escape are optional strings passed to csv-walker when supplied. Omitting them retains csv-walker's defaults: enclosure is ", and escape is \. Enclosure and escape must each be a single character, except that escape: "" disables CSV escaping.

csvToMarkdown("'name','note'\n'Ada','hello, world'", ",", true, {
  enclosure: "'",
  escape: "",
});

newlineReplacement sets the string used for newlines within CSV fields (LF, CR, or CRLF). It defaults to "<br>"; use "" to remove them or null to skip newline replacement and preserve the original newline characters. Existing calls without options retain the same behavior. TypeScript users can import the CsvToMarkdownOptions type; the argument accepts Partial<CsvToMarkdownOptions> so each setting can be supplied independently.

import type { CsvToMarkdownOptions } from "csv-to-markdown-table";

cellFilter accepts a (value: string, rowIndex: number, columnIndex: number) => string callback to transform each parsed CSV field, including headers and empty fields. It runs before tab and newline replacement, Markdown escaping, and column sizing. By default, values are returned unchanged.

Indexes are zero-based and refer to parsed CSV rows and columns, including the header row. Callbacks can ignore either or both indexes. For example, to uppercase only the first row:

csvToMarkdown(csv, ",", true, {
  cellFilter: (value, rowIndex) => rowIndex === 0 ? value.toUpperCase() : value,
});

Supplied options are merged with the defaults. Omit a property to use its default value; explicitly setting a property to undefined is unsupported. TypeScript users can enable exactOptionalPropertyTypes to catch this at compile time.

prettyPrint defaults to true, padding cells to align columns. Set it to false for compact output with outer pipes and three-dash separators. Spaces within cell values are preserved.

Both modes use the same input:

const csv = [
  "Name,Role,Location",
  "Ada Lovelace,Mathematician,London",
  "Grace Hopper,Computer scientist,New York",
].join("\n");

csvToMarkdown(csv, ",", true); // prettyPrint: true (default)
csvToMarkdown(csv, ",", true, { prettyPrint: false });

With prettyPrint: true, columns line up in the Markdown source:

| Name         | Role               | Location |
|--------------|--------------------|----------|
| Ada Lovelace | Mathematician      | London   |
| Grace Hopper | Computer scientist | New York |

With prettyPrint: false, only the cell content and table delimiters remain:

|Name|Role|Location|
|---|---|---|
|Ada Lovelace|Mathematician|London|
|Grace Hopper|Computer scientist|New York|

Both render as the same table.

cellWidth sets how cell widths are measured in pretty output. It defaults to JavaScript string length. A custom function receives escaped Markdown cell text. It must return a consistent, non-negative integer. It must return zero for an empty string.

Unicode Support

CSV parsing fully supports Unicode. Pretty printing works with Unicode text, but its default width calculation may misalign columns in the Markdown source. For better alignment across languages, you can use a Unicode-aware width library. These libraries add substantial code. To keep the package small, none is included by default.

Install string-width to measure display widths:

npm install string-width

Pass it as the cellWidth option:

import csvToMarkdown from "csv-to-markdown-table";
import stringWidth from "string-width";

const csv = "Name,City\nKenji,名前\nAda,Tokyo";
console.log(csvToMarkdown(csv, ",", true, { cellWidth: stringWidth }));

Display width can vary by font and environment.

Distribution Formats

This package is distributed in multiple formats:

  • UMD: Universal Module Definition for browsers and legacy environments (includes csvToMarkdown global variable when loaded in a browser)
    • lib/CsvToMarkdown.js (unminified)
    • lib/CsvToMarkdown.min.js (minified)
  • ESM: ES Modules for modern JavaScript environments
    • lib/CsvToMarkdown.mjs
  • CJS: CommonJS for Node.js
    • lib/CsvToMarkdown.cjs

The package.json is configured with the appropriate fields to ensure the correct format is used in each environment:

  • main: Points to the CommonJS build
  • module: Points to the ESM build
  • unpkg: Points to the minified UMD build
  • exports: Provides conditional exports for different environments

Testing

Install dependencies and run the tests from the project directory:

npm ci
npm test

The test command builds the project before running the tests.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm csv-to-markdown-table

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229