Skip to content
Back to skills

Express5

ASecurity

Patrones de Express 5 y TypeScript. Usa cuando trabajes con rutas, middleware, o cualquier codigo del backend API.

  • 2 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 9, 2026
businesstypescriptgoexpressapibackend

Works with

  • api

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add ramiroquesada/PROSEGUIT --skill express5 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Express5?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Express5
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ramiroquesada-express5/badge)](https://www.skillsdirectory.com/skills/ramiroquesada-express5)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: express5
description: Patrones de Express 5 y TypeScript. Usa cuando trabajes con rutas, middleware, o cualquier codigo del backend API.
---

# Express 5 - Patrones Modernos

Cuando escribas codigo backend para PROSEGUIT, usa exclusivamente APIs de Express 5:

## Cambios clave en Express 5
- **Async error handling nativo**: Los errores en funciones async se capturan automaticamente (no necesitas try/catch ni next(err) en cada handler)
- **`req.query` retorna `URLSearchParams`** (no objeto plano)
- **Path route matching** usa `path-to-regexp` v8 (sintaxis ligeramente diferente)
- **`res.render()` es async**
- **Removido**: `app.del()`, `req.param()`, `req.host` plural, `res.json(status, obj)`

## Patron de rutas PROSEGUIT
```typescript
import { Router } from 'express';

const router = Router();

// Express 5: async handlers atrapan errores automaticamente
router.get('/equipment', async (req, res) => {
  const data = await equipmentService.findAll(req.query);
  res.json(data);
});

// Express 5: nuevo path matching - usar {param} en vez de :param para regex
router.get('/equipment/:id', async (req, res) => {
  const equipo = await equipmentService.findById(req.params.id);
  res.json(equipo);
});

export default router;
```

## Middleware pattern
```typescript
import { Request, Response, NextFunction } from 'express';

// Express 5: middleware async tambien captura errores
const authMiddleware = async (req: Request, res: Response, next: NextFunction) => {
  const token = req.headers.authorization?.replace('Bearer ', '');
  if (!token) {
    res.status(401).json({ error: 'No autorizado' });
    return;
  }
  // verificar token...
  next();
};
```

## Error handler global
```typescript
// Express 5: error handler sigue siendo 4 parametros
app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
  console.error(err.stack);
  res.status(500).json({ error: 'Error interno del servidor' });
});
```

## Patrones a EVITAR
- NO envolver handlers async en try/catch generico -> Express 5 lo hace solo
- NO usar `req.param()` -> usar `req.params.nombre`
- NO usar `res.json(status, data)` -> usar `res.status(status).json(data)`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.