{"id":20720166,"url":"https://github.com/scalajs-io/csv-parse","last_synced_at":"2026-04-29T23:33:06.063Z","repository":{"id":77422512,"uuid":"81402817","full_name":"scalajs-io/csv-parse","owner":"scalajs-io","description":"CSV parsing implementing the Node.js stream.Transform API","archived":false,"fork":false,"pushed_at":"2019-06-17T23:07:59.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-13T14:46:37.277Z","etag":null,"topics":["csv","csv-parser","node","nodejs","npm","npm-package","scala","scalajs"],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/scalajs-io.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":"2017-02-09T03:05:55.000Z","updated_at":"2019-06-17T23:08:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ba8cb01-15a5-4503-9c18-1ea07498ab54","html_url":"https://github.com/scalajs-io/csv-parse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scalajs-io/csv-parse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsv-parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsv-parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsv-parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsv-parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalajs-io","download_url":"https://codeload.github.com/scalajs-io/csv-parse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsv-parse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csv","csv-parser","node","nodejs","npm","npm-package","scala","scalajs"],"created_at":"2024-11-17T03:19:32.770Z","updated_at":"2026-04-29T23:33:06.044Z","avatar_url":"https://github.com/scalajs-io.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"Csv-parse API for Scala.js\n================================\n[csv-parse](https://www.npmjs.com/package/csv-parse) - CSV parsing implementing the Node.js stream.Transform API.\n\n### Description\n\nPart of the CSV module, this project is a parser converting CSV text input into arrays or objects. \nIt implements the Node.js stream.Transform API. It also provides a simple callback-based API for convenience. \nIt is both extremely easy to use and powerful. It was first released in 2010 and is used against big data sets \nby a large community.\n\n### Build Dependencies\n\n* [SBT v1.2.x](http://www.scala-sbt.org/download.html)\n\n### Build/publish the SDK locally\n\n```bash\n $ sbt clean publish-local\n```\n\n### Running the tests\n\nBefore running the tests the first time, you must ensure the npm packages are installed:\n\n```bash\n$ npm install\n```\n\nThen you can run the tests:\n\n```bash\n$ sbt test\n```\n\n### Examples\n\n```scala\nimport io.scalajs.JSON\nimport io.scalajs.npm.csvparse._\nimport io.scalajs.npm.readablestream.Readable\nimport scalajs.js\n\nval text =\n    \"\"\"# A List of Super Heroes\n      |\"first\", \"last\", \"alter-ego\", \"votes\"\n      |\"Bruce\", \"Wayne\", \"Batman\", 1000\n      |\"Charles\", \"Xavier\", \"Professor X\", 890\n      |\"Clark\", \"Kent\", \"Superman\", 2000\n      |\"David\", \"Banner\", \"The Incredible Hulk\", 1985\n      |\"Peter\", \"Parker\", \"The Amazing Spider-Man\", 1999\"\"\".stripMargin\n\nval results = js.Array[js.Any]()\n\nval parser = CsvParse(new ParserOptions(\n    comment = \"#\",\n    auto_parse = true,\n    columns = true,\n    delimiter = \",\",\n    quote = \"\\\"\",\n    relax = true,\n    rowDelimiter = \"\\n\",\n    skip_empty_lines = true,\n    trim = true\n))\nparser.onData((data: js.Any) =\u003e results.push(data))\n\nval readable = new Readable()\nreadable._read = () =\u003e {}\nreadable.push(text)\nreadable.push(null)\nreadable.pipe(parser)\n\nreadable.onEnd(() =\u003e {\n  println(JSON.stringify(results, null, \" \"))\n})\n```\n\n##### Output:\n\n```text\n[\n {\n  \"first\": \"Bruce\",\n  \"last\": \"Wayne\",\n  \"alter-ego\": \"Batman\",\n  \"votes\": 1000\n },\n {\n  \"first\": \"Charles\",\n  \"last\": \"Xavier\",\n  \"alter-ego\": \"Professor X\",\n  \"votes\": 890\n },\n {\n  \"first\": \"Clark\",\n  \"last\": \"Kent\",\n  \"alter-ego\": \"Superman\",\n  \"votes\": 2000\n },\n {\n  \"first\": \"David\",\n  \"last\": \"Banner\",\n  \"alter-ego\": \"The Incredible Hulk\",\n  \"votes\": 1985\n },\n {\n  \"first\": \"Peter\",\n  \"last\": \"Parker\",\n  \"alter-ego\": \"The Amazing Spider-Man\",\n  \"votes\": 1999\n }\n]\n```\n\n### Artifacts and Resolvers\n\nTo add the `CsvParse` binding to your project, add the following to your build.sbt:  \n\n```sbt\nlibraryDependencies += \"io.scalajs.npm\" %%% \"csv-parse\" % \"0.5.0\"\n```\n\nOptionally, you may add the Sonatype Repository resolver:\n\n```sbt   \nresolvers += Resolver.sonatypeRepo(\"releases\") \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalajs-io%2Fcsv-parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalajs-io%2Fcsv-parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalajs-io%2Fcsv-parse/lists"}