Pass date and date format to isValidDate
function.
Function will validate and return true or false.
// Create Instance of the DateValidator
const DateValidator = require('simple-date-validator');
// This will return True
DateValidator.isValidDate("2017-09-27","YYYY-MM-DD");
// This will return False
DateValidator.isValidDate("27-09-27","YYYY-MM-DD");
Read the contributing guidelines here