{"id":22877041,"url":"https://github.com/shriansh2002/json-convertor","last_synced_at":"2026-04-09T16:11:22.584Z","repository":{"id":152167721,"uuid":"616797819","full_name":"Shriansh2002/json-convertor","owner":"Shriansh2002","description":"This package converts json to csv and xml","archived":false,"fork":false,"pushed_at":"2023-03-24T08:28:20.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T13:34:03.937Z","etag":null,"topics":["convert","csv","json","npm","npm-package","parse","xml","yarn"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/json-convertor","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/Shriansh2002.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":"2023-03-21T05:13:26.000Z","updated_at":"2023-04-06T21:07:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"b2c0cd35-0912-43ff-bf95-d52e6d91f27a","html_url":"https://github.com/Shriansh2002/json-convertor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Shriansh2002/json-convertor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shriansh2002%2Fjson-convertor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shriansh2002%2Fjson-convertor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shriansh2002%2Fjson-convertor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shriansh2002%2Fjson-convertor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shriansh2002","download_url":"https://codeload.github.com/Shriansh2002/json-convertor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shriansh2002%2Fjson-convertor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264887023,"owners_count":23678613,"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":["convert","csv","json","npm","npm-package","parse","xml","yarn"],"created_at":"2024-12-13T15:29:21.483Z","updated_at":"2026-04-09T16:11:22.496Z","avatar_url":"https://github.com/Shriansh2002.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON to CSV and XML Converter\n\nThis is a Node.js package that allows you to convert JSON data to CSV and XML formats. It is easy to use and can be integrated into your Node.js projects with just a few lines of code.\n\n## Installation\n\nYou can install this package using the npm package manager. Open a terminal window and run the following command:\n\n```bash\nnpm install json-convertor\n```\n\n## Usage\n\nTo use this package in your Node.js project, first require it at the top of your file:\n\n```javascript\nconst Converter = require('json-convertor');\n```\n\n## Converting JSON to CSV\n\nTo convert JSON data to CSV format, call the convertToCsv function, passing in the JSON data as a parameter:\n\n```javascript\nconst jsonData = [\n\t{ name: 'John', age: 30 },\n\t{ name: 'Jane', age: 25 },\n\t{ name: 'Bob', age: 40 },\n];\nconst csvData = convertToCsv(jsonData);\nconsole.log(csvData);\n```\n\nThis will output the following CSV data:\n\n```excel\n\"name\", \"age\"\n\"John\", 30\n\"Jane\", 25\n\"Bob\", 40\n```\n\n## Converting JSON to XML\n\nTo convert JSON data to XML format, call the convertToXml function, passing in the JSON data as a parameter:\n\n```javascript\nconst jsonData = {\n\tusers: [\n\t\t{ name: 'John', age: 30 },\n\t\t{ name: 'Jane', age: 25 },\n\t\t{ name: 'Bob', age: 40 },\n\t],\n};\nconst xmlData = convertToXml(jsonData);\nconsole.log(xmlData);\n```\n\nThis will output the following XML data:\n\n```xml\n\u003cusers\u003e\n    \u003cuser\u003e\n        \u003cname\u003eJohn\u003c/name\u003e\n        \u003cage\u003e30\u003c/age\u003e\n    \u003c/user\u003e\n    \u003cuser\u003e\n        \u003cname\u003eJane\u003c/name\u003e\n        \u003cage\u003e25\u003c/age\u003e\n    \u003c/user\u003e\n    \u003cuser\u003e\n        \u003cname\u003eBob\u003c/name\u003e\n        \u003cage\u003e40\u003c/age\u003e\n    \u003c/user\u003e\n\u003c/users\u003e\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshriansh2002%2Fjson-convertor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshriansh2002%2Fjson-convertor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshriansh2002%2Fjson-convertor/lists"}