{"id":15288392,"url":"https://github.com/bunlong/svelte-csv","last_synced_at":"2025-08-09T01:44:36.715Z","repository":{"id":42073714,"uuid":"364625068","full_name":"Bunlong/svelte-csv","owner":"Bunlong","description":"svelte-csv is the fastest in-browser CSV (or delimited text) parser for Svelte. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.","archived":false,"fork":false,"pushed_at":"2023-07-27T20:01:20.000Z","size":1713,"stargazers_count":12,"open_issues_count":6,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T07:49:05.365Z","etag":null,"topics":["csv","svelte","svelte-csv","sveltejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bunlong.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-05T15:35:02.000Z","updated_at":"2025-01-07T07:57:50.000Z","dependencies_parsed_at":"2022-08-20T07:31:59.625Z","dependency_job_id":null,"html_url":"https://github.com/Bunlong/svelte-csv","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Fsvelte-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Fsvelte-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Fsvelte-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Fsvelte-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bunlong","download_url":"https://codeload.github.com/Bunlong/svelte-csv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"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":["csv","svelte","svelte-csv","sveltejs"],"created_at":"2024-09-30T15:48:39.595Z","updated_at":"2025-04-13T07:49:12.262Z","avatar_url":"https://github.com/Bunlong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-csv\n\nsvelte-csv is the fastest in-browser CSV (or delimited text) parser for Svelte. It is full of useful features such as CSVDownloader, readString, jsonToCSV, readRemoteFile, CSVReader, ... etc.\n\n## 🔧 Install\n\nsvelte-csv is available on npm. It can be installed with the following command:\n\n```\nnpm install svelte-csv --save\n```\n\nsvelte-csv is available on yarn as well. It can be installed with the following command:\n\n```\nyarn add svelte-csv --save\n```\n\n## ℹ️ Note on usage with SvelteKit\n\nIf you are using `svelte-csv` with SvelteKit, you need to configure `svelte.config.js` as follows:\n\n```\n  kit: {\n    // ...\n    vite: {\n      optimizeDeps: {\n        include: ['papaparse']\n      }\n    }\n  }\n```\n\n## 📚 Useful Features\n\n* [x] CSVDownloader\n* [x] readString\n* [x] readRemoteFile\n* [x] jsonToCSV\n* [ ] CSVReader\n\n## 💡 Usage\n\n### 🎀 CSVDownloader\n\nIf you want to open your CSV files in Excel, you might want to set `bom={true}` or `bom`, default is `false`. This option adds the so called BOM byte `'\\ufeff'` to the beginning of your CSV files and tells Excel that the encoding is UTF8.\n\n#### Link\n\n```javascript\nimport { CSVDownloader } from 'svelte-csv';\n\n\u003cCSVDownloader\n  data={[\n    {\n      \"Column 1\": \"1-1\",\n      \"Column 2\": \"1-2\",\n      \"Column 3\": \"1-3\",\n      \"Column 4\": \"1-4\",\n    },\n    {\n      \"Column 1\": \"2-1\",\n      \"Column 2\": \"2-2\",\n      \"Column 3\": \"2-3\",\n      \"Column 4\": \"2-4\",\n    },\n    {\n      \"Column 1\": \"3-1\",\n      \"Column 2\": \"3-2\",\n      \"Column 3\": \"3-3\",\n      \"Column 4\": \"3-4\",\n    },\n    {\n      \"Column 1\": 4,\n      \"Column 2\": 5,\n      \"Column 3\": 6,\n      \"Column 4\": 7,\n    },\n  ]}\n  filename={'filename'}\n  bom={true}\n\u003e\n  Download\n\u003c/CSVDownloader\u003e\n```\n\n#### Link\n\n```javascript\nimport { CSVDownloader } from 'svelte-csv';\n\n\u003cCSVDownloader\n  data={[\n    {\n      \"Column 1\": \"1-1\",\n      \"Column 2\": \"1-2\",\n      \"Column 3\": \"1-3\",\n      \"Column 4\": \"1-4\",\n    },\n    {\n      \"Column 1\": \"2-1\",\n      \"Column 2\": \"2-2\",\n      \"Column 3\": \"2-3\",\n      \"Column 4\": \"2-4\",\n    },\n    {\n      \"Column 1\": \"3-1\",\n      \"Column 2\": \"3-2\",\n      \"Column 3\": \"3-3\",\n      \"Column 4\": \"3-4\",\n    },\n    {\n      \"Column 1\": 4,\n      \"Column 2\": 5,\n      \"Column 3\": 6,\n      \"Column 4\": 7,\n    },\n  ]}\n  type={'button'}\n  filename={'filename'}\n  bom={true}\n\u003e\n  Download\n\u003c/CSVDownloader\u003e\n```\n\n### 🎀 readString\n\n```javascript\nimport { readString } from 'svelte-csv';\n\nconst str = `Column 1,Column 2,Column 3,Column 4\n1-1,1-2,1-3,1-4\n2-1,2-2,2-3,2-4\n3-1,3-2,3-3,3-4\n4,5,6,7`;\n\nconst results = readString(str);\n```\n\n### 🎀 readRemoteFile\n\n```javascript\nimport { readRemoteFile } from 'svelte-csv'\n\nreadRemoteFile(\n  url,\n  {\n    complete: (results) =\u003e {\n      console.log('Results:', results)\n    }\n  }\n);\n```\n\n### 🎀 jsonToCSV\n\n```javascript\nimport { jsonToCSV } from 'svelte-csv';\n\nconst jsonData = `[\n  {\n      \"Column 1\": \"1-1\",\n      \"Column 2\": \"1-2\",\n      \"Column 3\": \"1-3\",\n      \"Column 4\": \"1-4\"\n  },\n  {\n      \"Column 1\": \"2-1\",\n      \"Column 2\": \"2-2\",\n      \"Column 3\": \"2-3\",\n      \"Column 4\": \"2-4\"\n  },\n  {\n      \"Column 1\": \"3-1\",\n      \"Column 2\": \"3-2\",\n      \"Column 3\": \"3-3\",\n      \"Column 4\": \"3-4\"\n  },\n  {\n      \"Column 1\": 4,\n      \"Column 2\": 5,\n      \"Column 3\": 6,\n      \"Column 4\": 7\n  }\n]`;\n\nconst results = jsonToCSV(jsonData);\n```\n\n## 📜 Changelog\n\nLatest version 1.2.8 (2022-02-15):\n\n  * Fix `'/node_modules/papaparse/papaparse.min.js?v=8573111b' does not provide an export named 'default`\n\nDetails changes for each release are documented in the [CHANGELOG.md](https://github.com/Bunlong/svelte-csv/blob/master/CHANGELOG.md).\n\n## ❗ Issues\n\nIf you think any of the `svelte-csv` can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.\n\n## 🌟 Contribution\n\nWe'd love to have your helping hand on contributions to `svelte-csv` by forking and sending a pull request!\n\nYour contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)\n\nHow to contribute:\n\n- Open pull request with improvements\n- Discuss ideas in issues\n- Spread the word\n- Reach out with any feedback\n\n## ⚖️ License\n\nThe MIT License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Fsvelte-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbunlong%2Fsvelte-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Fsvelte-csv/lists"}