Diferencia entre revisiones de «Instalación TypeScript»

De Wiki Proyectos Beta
Ir a la navegación Ir a la búsqueda
([feat] Add information about TypeScript)
Etiqueta: Revertido
 
(No se muestran 4 ediciones intermedias del mismo usuario)
Línea 42: Línea 42:
== Archivo tsconfig.json ==
== Archivo tsconfig.json ==


= Versiones =
{
 
    "compilerOptions": {
* TypeScript 4.7
      "strictNullChecks": false
* TypeScript 4.8 RC 1
    }
}

Revisión actual - 09:02 26 ago 2022

Instalación

Versiones

Estable

npm install -g typescript

Inestable

npm install -g typescript@rc

Verificar versión

tsc --version

Desinstalar

npm uninstall -g typescript

Ejemplo

Compilación

Por archivo específico

tsc hello.ts
node hello.js

Salida:

hello world

Hot reload

tsc hello.ts --watch

Por todos los archivos

tsc *.ts

Configuración

Archivo tsconfig.json

{
   "compilerOptions": {
     "strictNullChecks": false
   }
}