{"id":21611294,"url":"https://github.com/runnerty/executor-json2csv","last_synced_at":"2025-10-26T14:05:16.739Z","repository":{"id":41848097,"uuid":"268246518","full_name":"runnerty/executor-json2csv","owner":"runnerty","description":"Runnerty executor json2csv","archived":false,"fork":false,"pushed_at":"2023-09-26T11:40:59.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-26T18:20:22.377Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/runnerty.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":"2020-05-31T09:18:17.000Z","updated_at":"2022-04-26T17:47:29.000Z","dependencies_parsed_at":"2024-11-24T21:12:00.772Z","dependency_job_id":"77eb9e84-1ea2-4089-913f-ff9ea88f32b7","html_url":"https://github.com/runnerty/executor-json2csv","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Fexecutor-json2csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Fexecutor-json2csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Fexecutor-json2csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Fexecutor-json2csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runnerty","download_url":"https://codeload.github.com/runnerty/executor-json2csv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257279,"owners_count":20424131,"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":[],"created_at":"2024-11-24T21:11:52.053Z","updated_at":"2025-10-26T14:05:16.679Z","avatar_url":"https://github.com/runnerty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://runnerty.io\"\u003e\n    \u003cimg height=\"257\" src=\"https://runnerty.io/assets/header/logo-stroked.png\"\u003e\n  \u003c/a\u003e\n  \u003cp align=\"center\"\u003eSmart Processes Management\u003c/p\u003e\n\u003c/p\u003e\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]\n\u003ca href=\"#badge\"\u003e\n\u003cimg alt=\"code style: prettier\" src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg\"\u003e\n\u003c/a\u003e\n\n# Executor for [Runnerty]: JSON2CSV\n\n### Installation:\n\nThrough NPM\n\n```bash\nnpm i @runnerty/executor-json2csv\n```\n\nYou can also add modules to your project with [runnerty-cli]\n\n```bash\nnpx runnerty-cli add @runnerty/executor-json2csv\n```\n\nThis command installs the module in your project, adds example configuration in your `config.json` and creates an example plan of use.\n\nIf you have installed [runnerty-cli] globally you can include the module with this command:\n\n```bash\nrty add @runnerty/executor-json2csv\n```\n\n### Configuration sample:\n\nAdd in [config.json]:\n\n```json\n{\n  \"id\": \"json2csv_default\",\n  \"type\": \"@runnerty-executor-json2csv\"\n}\n```\n\n### Plan sample:\n\nAdd in [plan.json]:\n\n#### JSON Example\n\n```json\n[\n  {\n    \"planet\": \"Earth\",\n    \"radius\": 6371,\n    \"satellites\": [\n      {\n        \"name\": \"moon\",\n        \"radius\": 1737\n      }\n    ]\n  },\n  {\n    \"planet\": \"Mars\",\n    \"radius\": 3389,\n    \"satellites\": [\n      {\n        \"name\": \"phobos\",\n        \"radius\": 11267\n      },\n      {\n        \"name\": \"deimos\",\n        \"radius\": 6.2\n      }\n    ]\n  }\n]\n```\n\n#### Example 1:\n\n```json\n{\n  \"id\": \"json2csv_default\",\n  \"inputPath\": \"./planets.json\",\n  \"outputPath\": \"./planets.csv\"\n}\n```\n\n##### CSV Output\n\n```\n\"planet\",\"radius\",\"satellites\"\n\"Earth\",6371,\"[{\"\"name\"\":\"\"moon\"\",\"\"radius\"\":1737}]\"\n\"Mars\",3389,\"[{\"\"name\"\":\"\"phobos\"\",\"\"radius\"\":11267},{\"\"name\"\":\"\"deimos\"\",\"\"radius\"\":6.2}]\"\n```\n\n#### Example 2:\n\n```json\n{\n  \"id\": \"json2csv_default\",\n  \"inputPath\": \"./planets.json\",\n  \"outputPath\": \"./planets.csv\",\n  \"options\": {\n    \"fields\": [\"planet\", \"radius\", \"satellites.name\", \"satellites.radius\"]\n  },\n  \"transforms\": {\n    \"unwind\": { \"paths\": [\"satellites\"] }\n  }\n}\n```\n\n##### CSV Ouput\n\n```\n\"planet\",\"radius\",\"satellites.name\",\"satellites.radius\"\n\"Earth\",6371,\"moon\",1737\n\"Mars\",3389,\"phobos\",11267\n\"Mars\",3389,\"deimos\",6.2\n```\n\n#### Full params example:\n\n```json\n{\n  \"id\": \"json2csv_default\",\n  \"inputPath\": \"./input.json\",\n  \"input\": \"@GV(MY_JSON)\",\n  \"outputPath\": \"./output.csv\",\n  \"options\": {\n    \"fields\": [\"field1\", \"field2\", \"field3\"],\n    \"defaultValue\": \"NULL\",\n    \"header\": true,\n    \"escapedQuote\": \"\",\n    \"delimiter\": \";\",\n    \"eol\": \"\\r\\n\",\n    \"excelStrings\": true,\n    \"includeEmptyRows\": true,\n    \"withBOM\": true\n  },\n  \"transforms\": {\n    \"unwind\": { \"paths\": [\"items\", \"items.items\"], \"blankOut\": true },\n    \"flatten\": { \"objects\": true, \"arrays\": true, \"separator\": \"_\" }\n  }\n}\n```\n\n### Params\n\n#### Options\n\n| Option           | Description                                                                               |\n| ---------------- | ----------------------------------------------------------------------------------------- |\n| fields           | List of fields to process. Defaults to field auto-detection.                              |\n| defaultValue     | Default value to use for missing fields.                                                  |\n| quote            | Character(s) to use as quote mark. Defaults to '\"'.                                       |\n| delimiter        | Character(s) to use as delimiter. Defaults to ','. (default: \",\")                         |\n| escapedQuote     | Character(s) to use as a escaped quote. Defaults to a double `quote`, '\"\"'.               |\n| eol              | Character(s) to use as End-of-Line for separating rows. Defaults to '\\n'. (default: \"\\n\") |\n| excelStrings     | Wraps string data to force Excel to interpret it as string even if it contains a number.  |\n| header           | Boolean to Enable/Disable the column name header. (Enabled by defaults)                   |\n| includeEmptyRows | Boolean to Includes empty rows in the resulting CSV output.                               |\n| withBOM          | Boolean to Includes BOM character at the beginning of the CSV.                            |\n\n#### Transforms\n\n| Option      | Description                                                                              |\n| ----------- | ---------------------------------------------------------------------------------------- |\n| unwind      | Creates multiple rows from a single JSON document similar to MongoDB unwind.             |\n| - paths     | Unwind fields path.                                                                      |\n| - blankOut  | When unwinding, blank out instead of repeating data. Defaults to false. (default: false) |\n| flatten     | Nested javascript objects into a single level object.                                    |\n| - object    | Flatten nested objects. Defaults to false. (default: false)                              |\n| - arrays    | Flatten nested arrays. Defaults to false. (default: false)                               |\n| - separator | Flattened keys separator. Defaults to '.'. (default: \".\")                                |\n\n### More information:\n\nThis executor is a wrapper of the module json2csv (zemirco), for more information consult the website of the [json2csv].\n\n[runnerty]: http://www.runnerty.io\n[downloads-image]: https://img.shields.io/npm/dm/@runnerty/executor-json2csv.svg\n[npm-url]: https://www.npmjs.com/package/@runnerty/executor-json2csv\n[npm-image]: https://img.shields.io/npm/v/@runnerty/executor-json2csv.svg\n[david-badge]: https://david-dm.org/runnerty/executor-json2csv.svg\n[david-badge-url]: https://david-dm.org/runnerty/executor-json2csv\n[config.json]: http://docs.runnerty.io/config/\n[plan.json]: http://docs.runnerty.io/plan/\n[ejs]: https://ejs.co\n[runnerty-cli]: https://www.npmjs.com/package/runnerty-cli\n[json2csv]: https://github.com/zemirco/json2csv\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunnerty%2Fexecutor-json2csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunnerty%2Fexecutor-json2csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunnerty%2Fexecutor-json2csv/lists"}