logo
search icon
Close
FrameworkLibrariesCommunityDocumentation
Chapters
Deepkit Runtime Types // Examples

Iterate over class properties

Back to all Deepkit Runtime Types examples
import { ReflectionClass } from '@deepkit/type';

class User {
    id: number = 0;
    username: string = '';
    password: string = '';
}

const properties = ReflectionClass.from(User).getProperties();
for (const property of properties) {
    console.log(property.name, property.type);
}
IntroductionExamplesJoin Discord
App
Getting startedExamplesArguments & FlagsDependency InjectionModulesServicesEventsLoggerConfiguration
Framework
Getting startedExamplesDatabaseTestingDeploymentPublic Assets
Runtime Types
IntroductionGetting startedExamplesType AnnotationsReflectionSerializationValidationExtendCustom serializerExternal TypesBytecode
Dependency Injection
IntroductionGetting startedExamplesProvidersInjectionConfigurationScopes
Filesystem
Getting startedExamplesAppLocalMemoryAWS S3FTPsFTP (SSH)Google Storage
Broker
Getting startedCacheMessage BusMessage QueueAtomic LocksKey Value
HTTP
IntroductionGetting startedExamplesInput & OutputViewsDependency InjectionEventsMiddlewareSecurity
RPC
IntroductionGetting startedExamplesDependency InjectionSecurityErrorsTransport
Database ORM
IntroductionGetting startedExamplesEntitySessionQueryTransactionInheritanceRelationsEventsMigrationsORM BrowserRaw AccessSeedingComposite primary key
Plugins
Soft-Delete