Support alternative verbose syntax
This is a proposal for a potential enhancement to the syntax.
The short syntax is great; however, for those that need it, the verbose syntax would support:
- Coercion
- Validation
- Alternative Key Name
Example:
var toBoolean = require('truthy')
var isBoolean = require('util').isBoolean
module.exports = deo({
server: {
cors: {
default: true,
coerce: toBoolean,
check: isBoolean,
key: 'CORS_ENABLED'
}
}
})
What are your thoughts on https://github.com/hapijs/joi. Is this something that we potentially want to leverage?
+1 on joi
I use Joi and I think it's great in the right context but think it would be overkill for this. On the other hand, I do realize there are some users that would prefer such a thing as some may not be aware how easy it is to validate a simple value or two.
I dunno...I'm torn. I'd lean toward keeping it lean to start and provide examples then if we still need it, perhaps look into adding it.
Thoughts on the key names proposed? Any other suggestions to bat around?
+1 on joi
I have no issue with Joi; however, do consider that if we require it, we can no longer in good conscience call this lightweight
Or, minimalistic rather