DEV Community

Cover image for I have taken advantage of Excel's functionality to develop a CLI tool to better manage data
Lee
Lee

Posted on

I have taken advantage of Excel's functionality to develop a CLI tool to better manage data

Hello everyone! Today I would like to introduce this tool I developed - ejc-cli.

Practical issues

Sometimes, 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:

  • 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
  • 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
  • Sometimes json is not a good way to spread our data when we want to share it with other non developers

Why choose Excel to manage data

  • 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
  • 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
  • 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
  • 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.

Tools are born

Therefore, 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.

For more convenient use, ejc-cli does not require you to create a Excel yourself. It already has a Excel built-in, and you only need to execute:

ejc-cli gt
Enter fullscreen mode Exit fullscreen mode

Or save the template file to the specified directory:

ejc-cli gt './ xlsx_ template/'
Enter fullscreen mode Exit fullscreen mode

In this way, we can obtain a 'Excel' template file, and then replace the data in it with what you want. That's as simple as that.

Then export the json data:

ejc-cli -i './ xlsx_ template/template.xlsx'
Enter fullscreen mode Exit fullscreen mode

The results are as follows:

gif preview

Usage effect

End

I hope this tool can help you.

  • If you like it, you can give it a star
  • If you have any suggestions, you can give me a issue to improve it.

For more information about ejc-cli, you can check here.

Top comments (0)