I am using date-format package in node back end and I can get today date using
var today = dateFormat(new Date());
In the same
Try this:
var d = new Date(); // Today! d.setDate(d.getDate() - 1); // Yesterday!