{"id":19408639,"url":"https://github.com/4lessandrodev/process-csv-and-xml","last_synced_at":"2026-05-08T03:32:10.413Z","repository":{"id":105007460,"uuid":"469533687","full_name":"4lessandrodev/process-csv-and-xml","owner":"4lessandrodev","description":"process csv and xml file to mongo or local","archived":false,"fork":false,"pushed_at":"2022-04-04T02:21:58.000Z","size":153,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T14:23:47.175Z","etag":null,"topics":["csv","csv-parser","localhost","mongodb","processing","read-file-from-csv","read-xml","simple-project","stream","xml-parser"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4lessandrodev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-03-14T00:45:32.000Z","updated_at":"2022-04-04T13:02:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"311cbf91-36c3-48e6-a3a6-05dc2abfc552","html_url":"https://github.com/4lessandrodev/process-csv-and-xml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fprocess-csv-and-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fprocess-csv-and-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fprocess-csv-and-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fprocess-csv-and-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4lessandrodev","download_url":"https://codeload.github.com/4lessandrodev/process-csv-and-xml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240587479,"owners_count":19825005,"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","localhost","mongodb","processing","read-file-from-csv","read-xml","simple-project","stream","xml-parser"],"created_at":"2024-11-10T12:07:06.851Z","updated_at":"2026-05-08T03:32:05.377Z","avatar_url":"https://github.com/4lessandrodev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Process csv and xml files\n\n## Process and save data to mongo\n### The challenge\n\nThe user can upload two different types of files. xml or csv.\nBoth files contain the same types of content, but represented according to their respective format.\nThe system allows the user to upload either of these two files.\nThe system should process the two files and normalize them to json format.\nWhen normalizing, the user will inform if he wants to save the result locally or in a database in the cloud.\n\nRead file, transform data and save to local or to mongo atlas\n\n\u003cimg src=\"./stream.jpg\" width=\"100%\" alt=\"example\"\u003e\n\n### How to run this project\n\n- Create an account on mongo atlas [Link Here](https://www.mongodb.com/atlas/database)\n- Set your credential on .env file\n- Run the test `yarn test`\n- Run the project `yarn dev`\n\n### Route POST\n\ndestination: Local or Mongo\n```\nPOST http://localhost:3000/upload\n```\nBODY form-data\n\n\u003e the sample files you can find on `src/data`\n```\n{\n  file: sample.csv\n  destination: Local\n}\n```\nPAYLOAD\n```json\n{\n  \"success\": true\n}\n```\n### Route GET\n\nthe get route find documents on mongodb\n\n```\nGET http://localhost:3000/upload?limit=2\n```\n```json\n{\n  {\n    \"docs\": [\n        {\n            \"_id\": \"624a0077642d164fd3dcda65\",\n            \"Transaction\": \"Invoice0000001\",\n            \"Amount\": \"1,000.00\",\n            \"CurrencyCode\": \"USD\",\n            \"TransactionDate\": \"20/02/2019 12:33:16\",\n            \"Status\": \"Approved\"\n        },\n        {\n            \"_id\": \"624a0077642d164fd3dcda66\",\n            \"Transaction\": \"Invoice0000002\",\n            \"Amount\": \"300.00\",\n            \"CurrencyCode\": \"USD\",\n            \"TransactionDate\": \"21/02/2019 02:04:59\",\n            \"Status\": \"Failed\"\n        }\n    ]\n  },\n  \"count\": 12\n}\n```\n\n### Preview \n\n\u003cimg src=\"./post.png\" width=\"100%\" alt=\"example\"\u003e\n\n### Use on your project\n- Copy the files to your project \n- Call the function `processFileService`\n- You can provide a file from uploaded\n\nAny question feel free to message me [Linkedin](https://www.linkedin.com/in/alessandro-l-menezes-57906b71/)\n\n\n#### References\n\n- [node doc](https://nodejs.org/docs/latest-v15.x/api/stream.html#stream_event_pipe)\n- [node-js-stream](https://www.geeksforgeeks.org/node-js-stream-pipeline-method/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fprocess-csv-and-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4lessandrodev%2Fprocess-csv-and-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fprocess-csv-and-xml/lists"}