npm i -g typeorm
. You can also choose to use npx typeorm <params>
for each command if you prefer not having to install it.--require my-module-supporting-register
typeorm
at the start of the command, by either npx typeorm
or npm run typeorm
.npm install
to install all dependencies. Once all dependencies are installed, you need to modify ormconfig.json
and insert your own database settings. After that, you can run your application by running npm start
.--name
:--database
:docker-compose.yml
file using:typeorm init
is the easiest and fastest way to setup a TypeORM project.User
is an entity file and class name. Running the command will create a new empty entity in entitiesDir
of the project. To setup the entitiesDir
of the project you must add it in connection options:UserSubscriber
is a subscriber file and class name. Running the following command will create a new empty subscriber in the subscribersDir
of the project. To setup subscribersDir
you must add it in connection options:UserMigration
is a migration file and class name. Running the command will create a new empty migration in the migrationsDir
of the project. To setup migrationsDir
you must add it in connection options:schema:sync
is going to run use:QueryBuilder
caching, sometimes you may want to clear everything stored in the cache. You can do it using the following command: