const yup = require("yup")
var login_schema =yup.object().shape( {
name: yup.string().required('name is required').email(),
pwd: yup.string().required('pass is required')
})
let name_and_pass = {
name: '',
pwd: ''
}
try {
login_schema.validateSync(name_and_pass);
} catch (e ){
console.log(e.errors);
}