{"id":20720160,"url":"https://github.com/scalajs-io/csvtojson","last_synced_at":"2026-05-02T11:39:04.626Z","repository":{"id":77422507,"uuid":"81391382","full_name":"scalajs-io/csvtojson","owner":"scalajs-io","description":"A tool concentrating on converting csv data to JSON with customised parser supporting","archived":false,"fork":false,"pushed_at":"2019-06-17T23:08:04.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-11T07:52:30.594Z","etag":null,"topics":["csvtojson","node","nodejs","npm","npm-package","npmjs","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-09T00:36:58.000Z","updated_at":"2019-06-17T23:08:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"b76d77c5-321d-4802-8ee9-c1dfb5542edb","html_url":"https://github.com/scalajs-io/csvtojson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scalajs-io/csvtojson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsvtojson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsvtojson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsvtojson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsvtojson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalajs-io","download_url":"https://codeload.github.com/scalajs-io/csvtojson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fcsvtojson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27762497,"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","status":"online","status_checked_at":"2025-12-16T02:00:10.477Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["csvtojson","node","nodejs","npm","npm-package","npmjs","scala","scalajs"],"created_at":"2024-11-17T03:19:31.556Z","updated_at":"2025-12-16T10:03:22.252Z","avatar_url":"https://github.com/scalajs-io.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"csvtojson API for Scala.js\n================================\n[csvtojson](https://www.npmjs.com/package/csvtojson) - A tool concentrating on converting csv data to JSON with customised parser supporting\n\n#### Description\n\nNodejs csv to json converter. Fully featured:\n\n* Pipe in / Pipe out\n* Use as Command Line tool or a Node.js lib\n* Parse CSV to JSON or CSV column arrays\n* Support all types of CSV\n* Non-blocking parsing / multi core support\n* Extremely fast: 4 - 6 times faster than other csv parsers on node.js\n* Streaming data / low memory usage on large CSV data source\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##### Parse CSV from a string source\n\n```scala\nimport io.scalajs.npm.csvtojson._\nimport io.scalajs.util.JSONHelper._\n  \nval csvStr =\n    \"\"\"1,2,3\n      |4,5,6\n      |7,8,9\"\"\".stripMargin\n\nCsvToJson(new ParsingOptions(noheader = true))\n    .fromString(csvStr)\n    .onCsv { csvRow =\u003e\n        // this func will be called 3 times\n        println(csvRow.toJson) // =\u003e [1,2,3] , [4,5,6]  , [7,8,9]\n    }\n    .onDone { () =\u003e\n        // parsing finished\n    }\n```\n\n##### Parse CSV from a file\n\n```scala\nimport io.scalajs.npm.csvtojson._\nimport io.scalajs.util.JSONHelper._\n\nCsvToJson()\n    .fromFile(\"./src/test/resources/data.csv\")\n    .onJson { jsonObj =\u003e\n      // combine csv header row and csv line to a json object\n      // jsonObj.a ==\u003e 1 or 4\n      println(s\"json: ${jsonObj.toJson}\") // =\u003e {\"a\":\"1\",\"b\":\"2\",\"c\":\"3\"} , {\"a\":\"4\",\"b\":\"5\",\"c\":\"6\"}\n    }\n    .onDone { () =\u003e\n      // parsing finished\n    }\n```\n\nThe CSV file:\n\n```text\na,b,c\n1,2,3\n4,5,6\n```\n\n#### Artifacts and Resolvers\n\nTo add the `CsvToJson` binding to your project, add the following to your build.sbt:  \n\n```sbt\nlibraryDependencies += \"io.scalajs.npm\" %%% \"csvtojson\" % \"0.5.0\"\n```\n\nOptionally, you may add the Sonatype Repository resolver:\n\n```sbt   \nresolvers += Resolver.sonatypeRepo(\"releases\") ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalajs-io%2Fcsvtojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalajs-io%2Fcsvtojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalajs-io%2Fcsvtojson/lists"}