Skip to content

Instantly share code, notes, and snippets.

@Klerith
Last active January 14, 2025 18:04

Revisions

  1. Klerith revised this gist Sep 1, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion configurar-node-ts.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ npx tsc --init --outDir dist/ --rootDir src

    3. Crear scripts para dev, build y start ([Más sobre TS-Node-dev aquí](https://www.npmjs.com/package/ts-node-dev))
    ```
    "dev": "tsnd --respawn src/app.ts",
    "dev": "tsnd --respawn --clear src/app.ts",
    "build": "rimraf ./dist && tsc",
    "start": "npm run build && node dist/app.js"
    ```
  2. Klerith created this gist Aug 28, 2023.
    17 changes: 17 additions & 0 deletions configurar-node-ts.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # Node con TypeScript - TS-Node-dev (preferido)

    1. Instalar TypeScript y demás dependencias
    ```
    npm i -D typescript @types/node ts-node-dev rimraf
    ```
    2. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
    ```
    npx tsc --init --outDir dist/ --rootDir src
    ```

    3. Crear scripts para dev, build y start ([Más sobre TS-Node-dev aquí](https://www.npmjs.com/package/ts-node-dev))
    ```
    "dev": "tsnd --respawn src/app.ts",
    "build": "rimraf ./dist && tsc",
    "start": "npm run build && node dist/app.js"
    ```