# csv-reader

> High-performance Node.js CSV parser that handles broken quotes, stray CRs, and row length inconsistencies.

csv-reader is a paid AI agent skill on Agensi by Haiyang Lan, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $9 (one-time purchase)
- Creator: [Haiyang Lan](https://www.agensi.io/creators/haiyang-lan)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.0
- Last updated: 2026-11-24
- Security: scan passed (2026-11-24); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/csv-reader
- Tags: api, node-js, csv-parser, data-processing, json

## About this skill

Hand-parsing CSV files character-by-character is slow and prone to failure when encountering malformed data. This skill provides a high-performance Node.js implementation that processes CSV text in slices, outperforming standard reference readers while strictly adhering to complex parsing policies.

### What it does
- **Slice-based scanning** processes data in chunks rather than single characters to increase throughput.
- **Robust error handling** identifies and reports stray carriage returns, quote junk, and unterminated quotes.
- **Strict policy enforcement** handles quoted fields, escaped quotes, and CRLF normalization.
- **Row normalization** automatically manages short or long rows by padding or truncating to the initial record width.
- **Metadata generation** returns a structured object containing columns, rows, and a detailed error log.

### How it works
1. **Input Preparation** provide a JSON array containing the CSV text and a boolean header flag.
2. **Execution** run the `main.ts` script using Node 22 without external dependencies.
3. **Parsing** the tool drops byte order marks and normalizes line endings.
4. **Output Retrieval** collect the structured JSON results from the designated output directory.

### Frameworks & tools
This skill is built for Node.js 22 using only the standard library. It requires no npm installations and operates entirely offline.

### Why this beats prompting it yourself
Writing a CSV parser that correctly handles doubled quotes, mixed line endings, and junk characters while maintaining high performance is notoriously difficult. This implementation is pre-optimized and verified against a strict reading policy, ensuring consistent results without the trial-and-error of manual prompt-based coding.

### Use cases
- **Data migration** sanitizing messy CSV exports from legacy systems.
- **ETL pipelines** pre-processing large datasets before database ingestion.
- **Log analysis** parsing structured text logs with non-standard delimiters or line breaks.

### Known limitations
Requires Node.js 22 or higher. The parser is optimized for local file processing and does not support streaming over network sockets.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the csv-reader skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill handle malformed CSV data compared to standard libraries?

This parser is specifically engineered to handle 'dirty' data, such as stray carriage returns, unclosed quotes, and inconsistent row lengths, which typically cause standard parsers to crash or skip lines.

### Does this skill require an internet connection or external dependencies to function?

Yes, the skill is built for Node.js 22 using only the standard library, meaning it works entirely offline with zero external npm dependencies for maximum security and speed.

### Can the skill handle CSV files where some rows have more columns than others?

Absolutely; the parser includes a row normalization feature that automatically pads short rows or truncates long ones to match your initial record width, ensuring a consistent data structure.

### What exactly is included in the purchase of this skill?

You will receive the complete main.ts source code optimized for Node 22, along with documentation on how to input CSV text and retrieve the structured JSON metadata and error logs.

### Which AI agent frameworks is this CSV reader compatible with?

This skill is a standalone Node.js implementation that can be integrated into any AI agent framework or ETL pipeline capable of executing local scripts and handling JSON inputs.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
