Use this code generator developed with electron to boost your code efficiency

Time:2020-11-26

EasyCode-JavaScript

Using objects

Crud too many management page projects, EASYCODE with nodejs access to the database ability, one click to let you generate code

use

download

GitHub download and use

https://github.com/chendonmin…

Compiling and running

  1. clone

    git clone [email protected]:chendonming/easycode-javascript.git
  2. Installation dependency

    yarn
  3. Compile run
    Without XXX, this step is very difficult to succeed

    yarn electron-build

start

Connect to database

Using shortcut keysctrl+nOr through the menu buttonConnection > connect to the database
Use this code generator developed with electron to boost your code efficiency

Fill in the corresponding information, check the box, and you won’t have to fill in the form next time you come in.

Select crud information

Use this code generator developed with electron to boost your code efficiency
As shown in the figure, after filling in the data name and table name, the information of the table will be found.

Among them:

insertRepresents the display field when a new form is added
searchRepresents the field displayed when searching for a query
queryRepresents the fields displayed in the table table

Select template

Use this code generator developed with electron to boost your code efficiency
There are preset EJS templates, or you can choose your own EJS templates.

generate

Use this code generator developed with electron to boost your code efficiency
clickgenerateButton, code generated successfully.

clickOpen with vscodeYou can see that the code has been generated!

Use this code generator developed with electron to boost your code efficiency

About templates

How to customize a template

I have injected some variables into EJS:

Insertlist: array < field > // new field collection
Querylist: array < field > // query field collection
Searchlist: array < field > // search field collection
Suffix: string // suffix
// Name: templatename
A kind of : Object // lodash object, you can use lodash in EJS!!

The field information is as follows:

Collation: string,
Comment: string, // comment
Default: string, // default value
Field: string, // field name
Key: string, // key name
Null: string, // can be null
Privileges: string, // permissions
Type: string // type

In theory, as long as it can be generated according to the database, it can be generated!

Make good use of itNative JavaScriptandlodashCan complete any code, whether latervue3, orreactangularAfter all, the logic is written in EJS template

Data is dead, templates are alive

follow-up work

  • naturalJavaAfter the automatic generation of the back-end language, it will follow.
  • Multi database, dialect ability must be added

Last, last

Please let me know if you encounter any uncomfortable points in the process of usinghttps://github.com/chendonmin…

I hope to get your opinions, and hope EASYCODE JavaScript can be more perfect

Recommended Today

Talking about Java collection

preface Most programming languages provide array to save objects, and array is one of the most important data structures. However, the length of the array has been defined during initialization, which is immutable and troublesome to use. Therefore, Java inJDK 1.2The collection framework is added to the version to save and manipulate objects. The container […]