{"id":21747953,"url":"https://github.com/its-just-nans/csv-to-custom-json","last_synced_at":"2025-07-10T20:32:48.809Z","repository":{"id":137455995,"uuid":"372805835","full_name":"Its-Just-Nans/csv-to-custom-json","owner":"Its-Just-Nans","description":"Easily transform your CSV to a custom JSON with cool options","archived":false,"fork":false,"pushed_at":"2025-01-01T18:12:29.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T12:50:45.633Z","etag":null,"topics":["csv","csv-parser","csv-to-json","csvtojson","custom-json","json","nodejs"],"latest_commit_sha":null,"homepage":"https://n4n5.dev/csv-to-custom-json/","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/Its-Just-Nans.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":"2021-06-01T11:29:46.000Z","updated_at":"2025-01-01T18:12:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"16a501f5-81a8-4713-b2d8-f4159bf77864","html_url":"https://github.com/Its-Just-Nans/csv-to-custom-json","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Its-Just-Nans/csv-to-custom-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Its-Just-Nans%2Fcsv-to-custom-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Its-Just-Nans%2Fcsv-to-custom-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Its-Just-Nans%2Fcsv-to-custom-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Its-Just-Nans%2Fcsv-to-custom-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Its-Just-Nans","download_url":"https://codeload.github.com/Its-Just-Nans/csv-to-custom-json/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Its-Just-Nans%2Fcsv-to-custom-json/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264652683,"owners_count":23644309,"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","csv-parser","csv-to-json","csvtojson","custom-json","json","nodejs"],"created_at":"2024-11-26T08:11:11.641Z","updated_at":"2025-07-10T20:32:48.490Z","avatar_url":"https://github.com/Its-Just-Nans.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csv-to-custom-json \u0026middot; [![npm version](https://img.shields.io/npm/v/csv-to-custom-json.svg)](https://www.npmjs.org/package/csv-to-custom-json)\n\n- \u003chttps://its-just-nans.github.io/csv-to-custom-json/\u003e - demo\n- \u003chttps://www.npmjs.com/package/csv-to-custom-json\u003e - npm\n- \u003chttps://github.com/Its-Just-Nans/csv-to-custom-json-python\u003e - python version\n\nTransform your `.csv` file to a **custom** JSON structure :) ! In browser and NodeJS !\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand\u003c/summary\u003e\n\n- [csv-to-custom-json · ](#csv-to-custom-json--)\n  - [Simple documentation](#simple-documentation)\n    - [Simple case](#simple-case)\n    - [Structure JSON](#structure-json)\n    - [Options](#options)\n  - [Documentation](#documentation)\n  - [Examples](#examples)\n  - [Issues](#issues)\n  - [About](#about)\n  - [License](#license)\n\n\u003c/details\u003e\n\n## Simple documentation\n\n### Simple case\n\nYou just want to parse your `.csv` without structure :\n\n```javascript\nconst parseFile = require(\"csv-to-custom-json\");\nconst parsed = await parseFile(linkFile);\n```\n\n### Structure JSON\n\nFirst you need to create the schema of your future JSON\n\n```javascript\nconst schema = {\n    num1: \"int\",\n    num2: \"float\",\n    num3: \"string\",\n    num4 (value, allValues) {\n        // this is a callBack !\n    },\n    async num5 (value, allValues) {\n        // this is a async callBack !\n    }\n};\n// then\nconst parsedFile = await parseFile(\"myfile.csv\", schema);\n```\n\n\u003e Legend :\n\u003e\n\u003e - `num1`, `num2`, `num3`, `num4`, `num5` are rows from the `.csv`\n\u003e - You can see that the value of attribute define how variable will be parse\n\u003e - You can see that we can use callBack, the value returned by the callBack will be put in the result (if not `undefined` or `null`)\n\nThis program allow you to create complex structured JSON, like this :\n\n```javascript\nconst schema = {\n    hello: [\n        {\n            num4: \"int\",\n            num1: \"string\"\n        }\n    ],\n    hello2: [\n        {\n            num4: \"int\",\n            num1: [\n                {\n                    num3: \"string\"\n                }\n            ]\n        }\n    ]\n};\n// then\nconst parsedFile = await parseFile(\"myfile.csv\", schema);\n```\n\n### Options\n\nTo use options, you need to add a third parameters which is an object with options.\n\nExample :\n\n```javascript\nconst parsedFile = await parseFile(\"myfile.csv\", schema, {\n    debug: true,\n});\n```\n\nAll options are listed in the documentation (you can run [examples](#examples) to help you) !\n\n## Documentation\n\nA whole documentation is available on [./docs](./docs)\n\n## Examples\n\nTo see examples, you can do :\n\n```sh\nnpm run test\n```\n\nAnd see `*.test.js` files to know which code is used !\n\n## Issues\n\nOh no 😟 !\n\nGo here [csv-to-custom-json/issues](https://github.com/Its-Just-Nans/csv-to-custom-json/issues)\n\n## About\n\nI coded this instead of doing my homework 😳\n\nYou can discuss here : [csv-to-custom-json/discussions](https://github.com/Its-Just-Nans/csv-to-custom-json/discussions)\n\n## License\n\nLicensed under the MIT License - [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fits-just-nans%2Fcsv-to-custom-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fits-just-nans%2Fcsv-to-custom-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fits-just-nans%2Fcsv-to-custom-json/lists"}