2.0.2 • Published 12 months ago

config-decorator v2.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

config-decorator

PoC: simple config decorator with type casting, validation and env-driven out of the box

TL;DR

npm i config-decorator
import { Config, Nullable, Option } from 'config-decorator';

@Config('app')
export class AppConfig {
    @Option({
        type: 'number',
        default: 3000,
    })
    @Nullable()
    public readonly port!: number;
}

const appConfig = new AppConfig();
console.log(appConfig.port);
// 3000

Environment:

APP_PORT=3000
2.0.2

12 months ago

2.0.1

1 year ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago