1.0.0 • Published 4 years ago
yup-config v1.0.0
yup-config
Validate configuration objects using yup.
Usage
import * as Config from 'yup-config';
const ConfigSchema = {
http: Config.object({
port: Config.number().integer().default(3000),
}),
};
// load & validate directly from a file
const config = Config.loadConfig('path/to-config.json', ConfigSchema);
// validate from an object
Config.getConfig({ http: { port: 3000 } }, ConfigSchema);
1.0.0
4 years ago