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
I would take a look at moment.js if you are interested in doing calculations with dates, there are many issues you can run into trying to do it manually or even with the built in Date objects in JavaScript/node.js such as leap years and daylight savings time issues.
http://momentjs.com/
For example:
var moment = require('moment');
var yesterday = moment().subtract(1, 'days');
console.log(yesterday.format());