{"id":25799653,"url":"https://github.com/filipdanic/json2csvexporter","last_synced_at":"2026-08-19T12:30:18.860Z","repository":{"id":10248879,"uuid":"65096944","full_name":"filipdanic/json2csvexporter","owner":"filipdanic","description":"A simple little library for exporting simple JSON structures to a CSV file. ","archived":false,"fork":false,"pushed_at":"2023-01-05T18:34:58.000Z","size":306,"stargazers_count":5,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-08-04T09:20:23.396Z","etag":null,"topics":["csv","exporter","json"],"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/filipdanic.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}},"created_at":"2016-08-06T18:44:07.000Z","updated_at":"2022-05-01T10:59:50.000Z","dependencies_parsed_at":"2023-01-13T15:49:47.912Z","dependency_job_id":null,"html_url":"https://github.com/filipdanic/json2csvexporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/filipdanic/json2csvexporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipdanic%2Fjson2csvexporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipdanic%2Fjson2csvexporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipdanic%2Fjson2csvexporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipdanic%2Fjson2csvexporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filipdanic","download_url":"https://codeload.github.com/filipdanic/json2csvexporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipdanic%2Fjson2csvexporter/sbom","scorecard":{"id":399548,"data":{"date":"2025-08-11","repo":{"name":"github.com/filipdanic/json2csvexporter","commit":"58549854007cef7fccc4a908051378db4cdae2a5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 3/20 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"24 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T19:47:45.920Z","repository_id":10248879,"created_at":"2025-08-18T19:47:45.920Z","updated_at":"2025-08-18T19:47:45.920Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36782996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"online","status_checked_at":"2026-08-19T02:00:06.185Z","response_time":54,"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":["csv","exporter","json"],"created_at":"2025-02-27T15:47:32.300Z","updated_at":"2026-08-19T12:30:18.565Z","avatar_url":"https://github.com/filipdanic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json2csvexporter\n\nThis is a simple little library for exporting simple JSON structures to a CSV file. The download will trigger the user to save the file to their system. The library itself does not handle any File I/O.\n\nCurrently, json2csvexporter does not support nested JSON data. As such, you will probably need to reduce complex structures into a simple `key: value` schema.\n\nTo install:\n\n`npm i json2csvexporter --save`\n\nProvided are:\n* umd-formatted file: dist/CSVExportService.js (browser-ready)\n* commonjs-formatted file: lib/CSVExportService.js\n* es-module: module/CSVExportService.js\n\nTable of contents:\n\n1. [Simple Example](#simple-example)\n2. [Example with Custom Options](#example-with-custom-options)\n3. [Example with TSV and Formatters](#example-with-tsv-and-formatters)\n4. [JSON to CSV/TSV encoded String/Blob (without downloading on the client)](#json-to-csvtsv-encoded-stringblob-without-downloading-on-the-client)\n5. [API and Options Docs](#api-and-options-docs)\n6. [Browsers Support](#browsers-support)\n7. [Contributing](#contributing)\n\n## Simple Example\n\nIn this simple example we take a JSON object and print all of the properties in it to the CSV. There is also [an online demo available via CodeSandbox.](https://codesandbox.io/s/json2csvexporter-e8xbl)\n\n```javascript\nimport CSVExportService from 'json2csvexporter';\n...\nconst vehiclesJSON = [\n  {id: 1, make: 'Toyota', model: 'Corolla', year: 2014},\n  {id: 2, make: 'Ford', model: 'Mustang', year: 2012},\n  {id: 3, make: 'Toyota', model: '', year: ''}\n];\nconst exporter = CSVExportService.create();\nexporter.downloadCSV(vehiclesJSON);\n```\n\nThis will generate the following CSV:\n\n```csv\nid,make,model,year\n1,Toyota,Corolla,2014\n2,Ford,Mustang,2012\n3,Toyota,,\n```\n\n## Example with Custom Options\n\nIn this example, we will take the same JSON object from the previous example, but only print a list of properties that we want. We will also decorate the headers with different names.\n\n```javascript\nimport CSVExportService from 'json2csvexporter';\n...\nconst csvColumnsList = ['id', 'make', 'model', 'year'];\nconst csvColumnsMap = {\n  id: 'ID',\n  make: 'Make',\n  model: 'Model Name',\n  year: 'Year'\n};\nconst vehiclesJSON = [\n  {id: 1, make: 'Toyota', model: 'Corolla', year: 2014},\n  {id: 2, make: 'Ford', model: 'Mustang', year: 2012},\n  {id: 3, make: 'Toyota', model: '', year: ''}\n];\nconst exporter = CSVExportService.create({\n  columns: csvColumnsList,\n  headers: csvColumnsMap,\n  includeHeaders: true,\n});\nexporter.downloadCSV(vehiclesJSON);\n```\nThis will generate the following CSV:\n\n```csv\nID,Make,Model Name,Year\n1,Toyota,Corolla,2014\n2,Ford,Mustang,2012\n3,Toyota,,\n```\n\n## Example with TSV and Formatters\n\nIn this example, we will make a TSV file and create formatting functions to style the content of certain properties.\n\n```javascript\nimport CSVExportService from 'json2csvexporter';\n...\n// using the same vehiclesJSON as before...\n\nconst exporter = CSVExportService.create({\n  contentType: 'text/tsv',\n  filename: 'newformat.tsv',\n  delimiter: '\\t',\n  formatters: {\n    id: (id) =\u003e {\n      return `#${id}`;\n    },\n    model: (model) =\u003e {\n      return model || 'Unknown model';\n    },\n    year: (year) =\u003e {\n      return year || 'Unknown year';\n    }\n  }\n});\nexporter.downloadCSV(vehiclesJSON);\n\n```\n\nThis will generate the following TSV:\n\n```tsv\nid  make  model year\n#1  Toyota  Corolla 2014\n#2  Ford  Mustang 2012\n#3  Toyota  Unknown model  Unknown year\n```\n\n## JSON to CSV/TSV encoded String/Blob (without downloading on the client)\n\n```javascript\nimport CSVExportService from 'json2csvexporter';\n...\nconst vehiclesJSON = [\n  {id: 1, make: 'Toyota', model: 'Corolla', year: 2014},\n  {id: 2, make: 'Ford', model: 'Mustang', year: 2012},\n  {id: 3, make: 'Toyota', model: '', year: ''}\n];\nconst exporter = CSVExportService.create();\nexporter.dataToString(vehiclesJSON);\n```\n\nThis will return the CSV as a JavaScript String. This allows you to further manipulate the data, save to a file, a database or anything else.\n\nSimilarly, calling:\n\n```javascript\nexporter.createCSVBlob(vehiclesJSON);\n```\n\nWill return a `Blob {size: 76, type: \"text/csv\"}`, or in other words, a regular JavaScript blob object that is encoded as the type you specified (in this case a plain text/csv). You then manipulate this Blob object however you like.\n\n\n## API and Options Docs\n\n### Options\n\nWhen creating a new `CSVExportService` you can pass in an options objects. These are the options that you can use:\n\n- `columns`: an Array of Strings. Each element represents a property of the JSON object that should be extracted. If it is not provided, then the exporter will iterate through all of the properties.\n\n- `contentType`: the content type of the file. Default is `text/csv`\n\n- `delimiter`: the delimiter to separate values. The default is a comma.\n\n- `formatters`: an Object. Each property defines how to format a value corresponding to the same key.\n\n- `headers`: an Object. Works as a map to stylize keys in the header. E.g. `{firstName: 'First Name'}`\n\n- `includeHeaders`: a Boolean. Defaults to true.\n\n- `devMode`: a Boolean. Useful for debugging. Defaults to false.\n\n### API\n\nThe `CSVExportService` implements two static methods: `create(options)` which returns a new instance of CSVExportService and `download(data, options)` which initializes a new service and downloads the data right away.\n\nFor more info, dive into the code. It is a very simple class.\n\n## Browsers Support\n\n| [\u003cimg src=\"https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/edge.png\" alt=\"IE / Edge\" width=\"16px\" height=\"16px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eIE / Edge | [\u003cimg src=\"https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/firefox.png\" alt=\"Firefox\" width=\"16px\" height=\"16px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eFirefox | [\u003cimg src=\"https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/chrome.png\" alt=\"Chrome\" width=\"16px\" height=\"16px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eChrome | [\u003cimg src=\"https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/safari.png\" alt=\"Safari\" width=\"16px\" height=\"16px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eSafari | [\u003cimg src=\"https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/opera.png\" alt=\"Opera\" width=\"16px\" height=\"16px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eOpera | [\u003cimg src=\"https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/safari-ios.png\" alt=\"iOS Safari\" width=\"16px\" height=\"16px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eiOS Safari |\n| --------- | --------- | --------- | --------- | --------- | --------- |\n| IE10, IE11, Edge| 4+ | 13+ | 5+ | 12+ | 7+ |\n\n\n## Contributing\n\n1. Submit issues or suggest features.\n2. Send PRs with bug fixes, tests, new methods, better docs etc.\n3. Share the love!\n\n## Contributor list\n\n1. [@filipdanic](https://github.com/filipdanic)\n2. [@androidfanboi](https://github.com/androidfanboi)\n3. [@erickzhao](https://github.com/erickzhao)\n4. [@bira91](https://github.com/bira91)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipdanic%2Fjson2csvexporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilipdanic%2Fjson2csvexporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipdanic%2Fjson2csvexporter/lists"}