Skip to content

Instantly share code, notes, and snippets.

@Oosasukel
Last active September 7, 2020 15:33
Show Gist options
  • Save Oosasukel/07e7a606f275a439bd14029f7595515d to your computer and use it in GitHub Desktop.
Save Oosasukel/07e7a606f275a439bd14029f7595515d to your computer and use it in GitHub Desktop.
Typescript no Node

Typescript no Node

Vamos instalar o ts-node-dev e o typescript como dependências de desenvolvimento:

npm i -D ts-node-dev typescript

Para gerar o arquivo de configuração do typescript:

npx tsc --init

Podemos customizar posteriormente.

Usaremos o seguinte código para executar a aplicação:

ts-node-dev --transpile-only index.ts

Para maior performance em produção, vamos usar o código compilado. Para compilar:

tsc

Veja também:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment