{"id":16641817,"url":"https://github.com/samthor/tiddlycsv","last_synced_at":"2025-10-30T11:31:21.866Z","repository":{"id":252159280,"uuid":"839602427","full_name":"samthor/tiddlycsv","owner":"samthor","description":"small, streaming CSV parser (~1kb)","archived":false,"fork":false,"pushed_at":"2024-08-08T05:39:18.000Z","size":17,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-02T08:11:21.521Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samthor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-08T00:34:35.000Z","updated_at":"2024-10-23T00:12:51.000Z","dependencies_parsed_at":"2024-08-08T03:12:04.093Z","dependency_job_id":"c25bf7c9-1a90-429a-b024-9b25ee31fdb8","html_url":"https://github.com/samthor/tiddlycsv","commit_stats":null,"previous_names":["samthor/tiddlycsv"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Ftiddlycsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Ftiddlycsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Ftiddlycsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Ftiddlycsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samthor","download_url":"https://codeload.github.com/samthor/tiddlycsv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238960272,"owners_count":19559233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T07:47:59.259Z","updated_at":"2025-10-30T11:31:16.567Z","avatar_url":"https://github.com/samthor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"tiddlycsv is a small, streaming CSV parser.\nIt's about ~1.3kb, has zero dependencies, and is tree-shakable.\n\nDoesn't care about headers, keyed rows, anything but strings.\nJust supports the CSV spec including multi-line and quoted strings.\nSupports `\\r\\n` as well as `\\n` for line separators only (i.e., won't rewrite `\\r\\n` to `\\n` within multi-line strings).\n\n## Usage\n\nInstall `tiddlycsv`.\nIncludes types.\n\n### Methods\n\n- `parseCSV`: parses a whole string CSV into an array of arrays\n\n- `iterCSV`: returns a `Generator` for each line of a whole string CSV\n\n- `streamCSV`: returns a `ReadableStream` for each line of a streaming CSV\n\n- `streamCSVChunk`: returns a `ReadableStream` for chunks of the streaming CSV (faster)\n\n- `buildCSVChunkStreamer`: builds a low-level function which converts incoming CSV data into rows\n\n- `writeCSV`: simple method that converts array data into CSV string output (call multiple times to \"stream\")\n\nIn general, if the read helpers don't work for you, use `buildCSVChunkStreamer` and provide data your way.\nMinifying that method only is about ~0.55k.\n\n## Speed\n\nIt's fast for its size.\nTo parse multiple copies of [1.csv](https://github.com/Keyang/csvbench/blob/master/1.csv):\n\n```\ntiddlycsv: 837.074ms (baseline) ~1.3kb\nudsv: 540.037ms (0.63x) ~5kb\nbut-csv: 737.836ms (0.88x) ~0.5kb\npapaparse: 1.120s (1.34x) ~20kb\n```\n\n## Output\n\nUnlike other parsers, `tiddlycsv` will return empty strings for trailing commas and empty lines.\nIt skips the last input line if it does not have any data.\nFor the input data:\n\n```csv\nName,Age\nSam,37\nJim,\n\nAnne,56\n```\n\nYou'll get results like:\n\n```json\n[[\"Name\", \"Age\"], [\"Sam\", \"37\"], [\"Jim\", \"\"], [\"\"], [\"Anne\", \"56\"]]\n```\n\nShould this be configurable?\nMaybe!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Ftiddlycsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamthor%2Ftiddlycsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Ftiddlycsv/lists"}