{"id":27553010,"url":"https://github.com/limingcan562/ejc-cli","last_synced_at":"2025-04-19T11:42:38.276Z","repository":{"id":107902945,"uuid":"609227219","full_name":"limingcan562/ejc-cli","owner":"limingcan562","description":"Manage your json data better with visual Excel sheets |  用可视化的Excel表格更好地管理你的json数据","archived":false,"fork":false,"pushed_at":"2023-12-22T09:42:26.000Z","size":1073,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T10:43:54.330Z","etag":null,"topics":["cli","convert","converter","excel","javascript","json","node","terminal","tool","tools","xlsx"],"latest_commit_sha":null,"homepage":"","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/limingcan562.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-03T16:35:03.000Z","updated_at":"2025-04-10T08:28:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"35b3ef5a-5650-4a40-a96f-1654f15fdaa1","html_url":"https://github.com/limingcan562/ejc-cli","commit_stats":{"total_commits":62,"total_committers":2,"mean_commits":31.0,"dds":"0.016129032258064502","last_synced_commit":"f5d06567797272b32f5d6d4529ca811fea8d36f0"},"previous_names":["limingcan562/excel-json-cli"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limingcan562%2Fejc-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limingcan562%2Fejc-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limingcan562%2Fejc-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limingcan562%2Fejc-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limingcan562","download_url":"https://codeload.github.com/limingcan562/ejc-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249685344,"owners_count":21310588,"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":["cli","convert","converter","excel","javascript","json","node","terminal","tool","tools","xlsx"],"created_at":"2025-04-19T11:42:37.344Z","updated_at":"2025-04-19T11:42:38.268Z","avatar_url":"https://github.com/limingcan562.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"./media/logo.svg?v=1\" width=\"70%\"\u003e\n\nManage your `json` data better with visual Excel sheets\n\n![npm](https://img.shields.io/npm/v/ejc-cli?logo=npm)\n![download](https://img.shields.io/npm/dm/ejc-cli)\n![license](https://img.shields.io/npm/l/ejc-cli)\n\nEnglish | [简体中文](./READEME_zh-CN.md)\n\n\u003c/div\u003e\n\n## Effect preview\n\nTemplate `Excel` files：\n\n![Template `Excel` files](./media/template_excel.png)\n\nUsage effect:\n\n![Usage effect](./media/preview.gif)\n\nOutput `json` data:\n\n![Output `json` data](./media/effects.png)\n\n## Introduction\n\u003e `ejc-cli`, the first three letters of which consist of the initials `excel`, `json`, `cli`.\n\n### Practical issues\nSometimes, in order to save back-end development costs, we use `json` files to store some data locally, and then use these data for rendering. However:\n\n- If there are too many pages or modules that require data, the corresponding `json` files will also increase. There are too many files and data is too fragmented, making managing so many files difficult\n- When the amount of data is large, the data can become very lengthy, and it is difficult to directly find a specific piece of data\n- Sometimes `json` is not a good way to spread our data when we want to share it with other non developers\n\n### Why choose Excel to manage data\n- More convenient operation. Excel is a professional office software. Adding, deleting, modifying, and querying data in Excel is of course much more convenient than modifying it in our editor\n- More visual. Each sheet can be used as data for a certain page or module; The name of each sheet is the name of our json; Each row of data in the sheet is the data of each of our `json`\n- More convenient management. The data is integrated into an Excel file, making it easier for us to manage the data of all modules or pages\n- More suitable for dissemination. `json` is not suitable for dissemination among non developers, but Excel is suitable for all people. Not only can non developers modify this Excel, but if you find a problem in Excel, you can also modify it and then sync it to others.\n\n### Tools are born\nTherefore, in order to solve the above problems and combine the comprehensive advantages of Excel, `ej-cli` was born, so you only need to focus on managing the Excel file.\n\n\n## Quick start\n### 1. Installation tools\n````npm\nnpm i ejc-cli -g\n````\n### 2. Get the template excel file\nYou don't need to make an excel sheet yourself, a template excel file is already made here, you just need to execute:\n````npm\nejc-cli gt\n````\nOr save the template file to the specified directory:\n````npm\nejc-cli gt './xlsx_template/'\n````\nThis will give us access to an excel template file, then just replace the data in it with what you want, yes it's that simple.\n### 3. Exporting `json` files\n\u003e You can go to the [Explanation](#Explanation) module for a better understanding of `-k`, `-s`\n- Setting `-k`, `-s` output using the global method   \n\n    If you have more than one `sheet` in your excel file and they have a similar structure (like the two `sheets` in the `template.xlsx` file), then you can simply set:\n    ````npm\n    ejc-cli -i './xlsx_template/template.xlsx' -k 'order,title,date,director,genre,cast,money' -s 3 -n 'movieData,songData'\n    ````\n    In this case, `ejc-cli` will read the data from `row 3` of all `sheets` and the `key` values of all the output `json` data will be `order, title, date, director, genre, cast, money`.\n\n- Set `-k`, `-s` output separately \n\n    If you have more than one `sheet` in your excel file, and each `sheet` does not always start reading data from `line 3`, and each `sheet` does not always have the same `key` value, then you can use the \"`|`\" splitter:\n    ````npm\n    ejc-cli -i './xlsx_template/template.xlsx' -k 'order,title,date|num,song_title,artist' -s '3|4' -n 'movieData,songData'\n    ````\n    In this case, `ejc-cli` will read the data of the first `sheet` starting from `line 3`, and the `json` data key value of the first `sheet` will be `order, title, date`.  \n    `ejc-cli` will read the data of the second `sheet` starting from `line 4`, and the `json` data key values of the second `sheet` are `num, song_title, artist`\n- Integrate into your project  \n  - Configure relevant commands in `package.json`: \n    ```json \n    {\n      \"script\": {\n        \"get:data\": \"ejc-cli -i ./xlsx_template/template.xlsx -k \\\"order,title,date|num,song_title,artist\\\" -s \\\"2|3\\\" -n 'movieData,songData'\"\n      }\n    }\n    ````\n  - Run the relevant `scrpit` command to output the data: \n    ```npm\n    npm run get:data\n    ```\n\n## Notice\nHere are the following caveats in use.\n- When generating `json` data, make sure that the value of `-s` is correct. `-s` means that the data is read from the first row of each `sheet`, the default is `row 3`.\n- When the number of `-k` values is set to less than the number of columns in the `sheet`, it will render with the number of `-k` values  \n  \n  You can try running the following command to see the difference in the output data\n  ````npm\n  ejc-cli -i './xlsx_template/template.xlsx' -k 'order,title' -n 'movieData,novelData'\n  ````\n  The output of the `json` data is only `order` and `title` values\n- When integrating `ejc-cli` into your project: \n  - All statements can be made without `'` single quotes\n  - **When using the `|` delimiter, please use the escape character for compatibility with different systems. (`2|3` =\u003e `\\\"2|3\\\"`)**\n\n\n## Options and commands\n````npm\nUsage: ejc-cli [options] [command]\n\n=\u003e Manage your json data better with visual excel sheets\n\nOptions:\n  -v                        View current version\n  -i, --input [path]        Path of excel to be converted\n  -o, --output [path]       Path to the output json file\n  -n, --json-name [string]  Name of the output json file\n  -k, --keys [string]       The key value corresponding to each column of each sheet\n  -s, --start-row [number]  Read data from what row of sheet\n  -h, --help                View help\n\nCommands:\n  gt [path]                 Get the excel template file\n````\n\n### Options\n| Parameters | Required | Default | Description | Supplementary\n| ---| --- | --- | --- | ---\n| `-v` | No | | View current version | \n| `-i` | Yes | | Path to the excel sheet to be converted |\n| `-o` | No | `xlsx_json` folder in the current directory | `json` file output path |\n| `-n` | No | Default `sheet` number index naming\u003c/br\u003e (`data_1.json, data_2.json,... `) | Output `json` file name |\n| `-k` | No | The default is to use the current index of each column as the `key`.\u003c/br\u003e（`[{key_1: ''}, {key_2: ''},...]`） | Each column in the `sheet` corresponds to the name of the `key` value to be set | You can use \u003ccode\u003e\u0026#124;\u003c/code\u003e to set the `key` of the `json` data exported from each `sheet`\n| `-s` | No | `3` | Which row to start reading data from in an excel sheet  |  You can use \u003ccode\u003e\u0026#124;\u003c/code\u003e to set the row from which each `sheet` is to be read\n| `-h` | No | | View Help\n\n### Commands\n| Statement | Parameters | Description\n| ---|  --- |  --- |\n| `gt` | `path` | `path` is the directory where the template excel file is saved.\u003c/br\u003eWhen `path` is empty, the template excel file is saved in the `xlsx_template` folder of the current directory by default\n\n## \u003ca id=\"Explanation\"\u003eExplanation\u003c/a\u003e\nWe can look at the structure of the obtained template excel file (`template.xlsx`): \n\n![structure](./media/structure.png)\n\nThe overall structure of the table is generally divided into three blocks (`top`, `middle`, `bottom`).\n- The first block, which we call (`T`), refers to the broad heading of the entire table\n- The second, which we call (`M`), is an overview of the information in each column of the table and is also used to set the corresponding `key` value (`-k 'order,title,date,director,genre,cast,money'`)\n- The third block, which we will call (`B`), is the number of rows in which the program will start reading data (`-s 3`)\n\n## How to use your own excel sheet\nBecause everyone's production of excel is different, we strongly recommend that you use our template excel file (`template.xlsx`) to manage your data, but this file may not always be styled to suit you.  \n\nSo if you want to `DIY` the style of your table, according to the analysis of the [Explanation](#Explanation) module, the following rules need to be followed when `DIY`ing your table:\n- The `T` and `M` modules are not required, **but please ensure that the data in your excel file, has the same structure as the `B` module in the above diagram**\n- Please ensure that your `-s` values are correct\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimingcan562%2Fejc-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimingcan562%2Fejc-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimingcan562%2Fejc-cli/lists"}