javascript-example icon indicating copy to clipboard operation
javascript-example copied to clipboard

TypeORM CLI for ES6

Open sslgeorge opened this issue 8 years ago • 5 comments

When I use the CLI to generate migrations or entities it still generates as typescript.

sslgeorge avatar Jul 23 '17 12:07 sslgeorge

file generation for es6 is not supported yet. Feel free to add its support - its easy to do. We can set extra flag in cli, something like typeorm entity:create --es6 and based on this it will generate es6 entity classes. Also we can add option to ormconfig.json like language: es6 and cli will read this format as a generation default.

pleerock avatar Jul 24 '17 13:07 pleerock

@pleerock the typeorm tool told me there isnt an option like --es6

yunfan avatar Apr 11 '19 05:04 yunfan

file generation for es6 is not supported yet. Feel free to add its support - its easy to do. We can set extra flag in cli, something like typeorm entity:create --es6 and based on this it will generate es6 entity classes. Also we can add option to ormconfig.json like language: es6 and cli will read this format as a generation default.

Are es6 supported now?

mrtnzagustin avatar Feb 17 '20 21:02 mrtnzagustin

Is there any example for migration with javascript only?

allandiego avatar Apr 15 '20 14:04 allandiego

@allandiego check this issue and this comment, typeorm cli does not support generating migrations files from and to plain javascript files. They should update their doc. Anyway, typeORM is typescript driven, so i understand that the new features are always being writen first to be "typescript" compatible, dont expect to make a full exploitation of typeORM if you want to use js or es6, at least by now.

mrtnzagustin avatar Apr 15 '20 15:04 mrtnzagustin