TypeScript Decorators Cheat Sheet

Class, method, parameters

Last Updated: November 21, 2025

Decorator Types

Decorator Purpose
Class Wrap constructors
Property Intercept access
Method Wrap calls
Parameter Attach metadata

Commands

@Injectable()
Mark DI classes
@Reflect.metadata
Attach metadata
@LogMethod()
Wrap methods

Guidance

Return new descriptors sparingly and document expectations.

💡 Pro Tip: Enable `experimentalDecorators` and keep decorator logic focused.
← Back to Programming Languages | Browse all categories | View all cheat sheets