You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to provide a method which checks if a key or keypath exists or not , like in the example shown below ?
var convict = require("convict");
var config = convict({
env: {
doc: 'The application environment.',
format: String,
default: 'development',
env: 'NODE_ENV'
},
ip: {
doc: 'The IP address to bind.',
format: String,
default: '127.0.0.1',
env: 'IP_ADDRESS',
},
port: {
doc: 'The port to bind.',
format: 'int',
default: 8080,
env: 'PORT',
arg: 'port'
}
});
config.get('ports'); // gives me error since its not in schema
/*
can we have something like this ?
if (config.checkpath('ports')){
}
else
{
}
*/
The text was updated successfully, but these errors were encountered:
Is it possible to provide a method which checks if a key or keypath exists or not , like in the example shown below ?
The text was updated successfully, but these errors were encountered: