{"id":16595954,"url":"https://github.com/arslanameer/csv-exporter","last_synced_at":"2025-10-29T12:30:40.368Z","repository":{"id":153901023,"uuid":"631068847","full_name":"ArslanAmeer/csv-exporter","owner":"ArslanAmeer","description":"CSV Exporter Utility is a simple, yet powerful package that allows you to easily convert a JSON array of data into a CSV file and download it in a user-friendly way. This utility is highly useful when you need to export data from a web application or API to a CSV file format, which can then be imported into other tools or processed further.","archived":false,"fork":false,"pushed_at":"2024-09-07T20:44:23.000Z","size":86,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-07T22:36:53.650Z","etag":null,"topics":["arslanameer","csv","csv-converter","csv-export","data-conversion","data-export","file-download","json-to-csv","typescript","typescript-utility","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/csv-exporter-utility","language":"TypeScript","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/ArslanAmeer.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-21T21:08:37.000Z","updated_at":"2024-09-07T20:43:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"7563af09-ecb8-4799-8201-aff03cfe4e8d","html_url":"https://github.com/ArslanAmeer/csv-exporter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArslanAmeer%2Fcsv-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArslanAmeer%2Fcsv-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArslanAmeer%2Fcsv-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArslanAmeer%2Fcsv-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArslanAmeer","download_url":"https://codeload.github.com/ArslanAmeer/csv-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219857757,"owners_count":16556056,"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":["arslanameer","csv","csv-converter","csv-export","data-conversion","data-export","file-download","json-to-csv","typescript","typescript-utility","utility"],"created_at":"2024-10-11T23:51:57.383Z","updated_at":"2025-10-29T12:30:40.025Z","avatar_url":"https://github.com/ArslanAmeer.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/arslanameer"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" float=\"left\"\u003e\n     \u003cimg src=\"./export-csv.png\" alt=\"export-as-csv\" width=\"80\"\u003e\n     \u003cimg src=\"./ts-utility.png\" alt=\"typescript-utility-function\" width=\"80\"\u003e\n\u003c/p\u003e\n\n# CSV Exporter Utility\n\n## Description\n\nCSV Exporter Utility is a simple, yet powerful package that allows you to easily convert a JSON array of data into a CSV file and download it in a user-friendly way. This utility is highly useful when you need to export data from a web application or API to a CSV file format, which can then be imported into other tools or processed further.\n\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/arslanameer)\n\n\n## Why use CSV Exporter Utility\n\n- Easy to integrate into your existing projects\n- Lightweight with no external dependencies\n- Handles complex JSON data structures and nested objects\n- Automatically generates CSV headers from JSON keys\n- Allows omission of specific properties from the CSV export\n- Supports nested properties omission with dot notation\n- Cross-browser compatibility\n- User-friendly file download experience\n\n## How to use CSV Exporter Utility\n\n1. Install the package using npm or yarn:\n\n```bash\nnpm install csv-exporter-utility\n```\n\n2. Import the `downloadCSVFile` function from the package:\n\n```typescript\nimport { downloadCSVFile } from \"csv-exporter-utility\";\n```\n\n3. Use the `downloadCSVFile` function in your application to convert and download JSON data as a CSV file. You can also pass an array of property names to omit certain fields from the CSV:\n\n```typescript\nconst jsonData = [\n  { id: 1, name: \"John Doe\", email: \"john@example.com\" },\n  { id: 2, name: \"Jane Doe\", email: \"jane@example.com\" },\n];\n\n// Omit the \"email\" field from the CSV\ndownloadCSVFile(jsonData, \"users\", [\"email\"]);\n```\n\nIn the above example, the `email` field is omitted from the downloaded `users.csv` file.\n\n### Additional support: Dot notation for nested properties\n\nYou can also omit nested properties using dot notation:\n\n```typescript\n// Omit the \"user.age\" field from the CSV\ndownloadCSVFile(jsonData, \"users\", [\"user.age\"]);\n```\n\nThis will omit the `age` field inside the `user` object, allowing more control over complex JSON data structures.\n\n## When to use CSV Exporter Utility\n\nUse CSV Exporter Utility when you need to:\n\n- Export data from your web application to a CSV file\n- Provide users with a simple way to download data in a structured format\n- Convert JSON data to CSV for further processing or analysis\n- Omit specific properties (including nested ones) from the CSV output\n- Integrate a lightweight CSV export solution without external dependencies\n\n## Requirements and dependencies\n\nCSV Exporter Utility is written in TypeScript and has no external dependencies. However, you need to ensure that your project uses TypeScript and has the necessary TypeScript configuration in place.\n\nTo use this package, your project should have the following:\n\n- TypeScript version 4.x or higher\n- A properly configured `tsconfig.json` file\n- Node.js version 12.x or higher (if using the package in a Node.js environment)\n\nFor more information on setting up TypeScript in your project, please refer to the [official TypeScript documentation](https://www.typescriptlang.org/docs/).\n\n## License\n\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT). You are free to use, modify, and distribute this package, provided that you include the copyright notice and the license text. For more information, please see the [LICENSE](./LICENSE) file.\n\n## Author\n\nCSV Exporter Utility is developed and maintained by [Arslan Ameer](https://github.com/arslanameer). If you have any questions or need help, feel free to open an issue on the [GitHub repository](https://github.com/arslanameer/csv-exporter-utility).\n\n## Contributing\n\nContributions to CSV Exporter Utility are welcome and greatly appreciated! If you would like to contribute, please follow these steps:\n\n1. Fork the repository on GitHub.\n2. Clone your fork and create a new branch for your changes.\n3. Commit and push your changes to your fork.\n4. Create a Pull Request on the original repository, describing your changes and referencing any related issues.\n\nPlease make sure to follow the existing coding style and add tests for any new features or bug fixes. Your contributions will be reviewed and, if approved, merged into the main repository.\n\nThank you for your interest in contributing to CSV Exporter Utility!\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/arslanameer)\n\n\n# Changelog\n\n### v1.1.0 - [September 7, 2024]\n- **New Features**:\n  - Added support to omit specific properties from CSV output using the `omitProperties` parameter.\n  - Enhanced functionality to omit nested properties using dot notation (e.g., `\"user.age\"` will omit the `age` field from the `user` object).\n  \n- **Improvements**:\n  - Refined CSV formatting logic to handle omitted properties more efficiently.\n  - Improved error handling for scenarios with missing or invalid property paths in dot notation.\n\n- **Bug Fixes**:\n  - Resolved an issue where certain fields with nested structures were not properly converted to CSV.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farslanameer%2Fcsv-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farslanameer%2Fcsv-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farslanameer%2Fcsv-exporter/lists"}