$ show auth0/express-jwt
This repository is the `express-jwt` npm package, a widely-used Express.js middleware for validating JSON Web Tokens (JWTs). The core function `expressjwt(options)` returns a middleware that extracts the JWT from the request (defaulting to the Authorization Bearer header), decodes it, verifies its signature using a provided secret or async callback, checks standard claims like audience and issuer, and optionally checks token revocation. The decoded payload is attached to `req.auth`. The middleware supports CORS preflight handling and integrates with `express-unless` for conditional skipping. It is a focused, well-structured library with clean TypeScript types and a simple architecture. The code is actively maintained by Auth0 with automated CI/CD for releases and testing across multiple Node.js versions. The primary reusable component is a generic deep property setter utility.
The LLM identified 1 files worth highlighting for reuse:
A standalone utility function that sets a nested property on an object given a dot-separated path or array of keys. It handles creation of intermediate objects or arrays based on whether the next key looks like an array index. This function is self-contained, has no dependencies on the rest of the project, and could be extracted into any JavaScript/TypeScript project for deep property assignment. It demonstrates clean recursion-like reduction pattern and safe type handling.