#!/usr/bin/node if (!process.argv[2]) { console.error("Missing argument: yyyy-mm-dd"); process.exit(1); } const moment = require("moment"); const birthday = moment(process.argv[2]); let now = moment(); for (let m = moment(birthday); m.isSameOrBefore(now); m.add(1, 'y')) { const diff = m.diff(birthday, 'years'); console.log(m.format("ddd") + ", " + m.year() + ", " + diff + " " + (diff === 1 ? "year" : "years") + " old"); }