migrate-mongo icon indicating copy to clipboard operation
migrate-mongo copied to clipboard

Remove date-fns

Open AlexGrump opened this issue 5 years ago • 2 comments

We build docker images and every megabyte of memory is important to us. Date-fns weighs more then 40mb, and looks like a useless.

image

AlexGrump avatar Aug 19 '20 09:08 AlexGrump

Yes. Please remove. Replace with following (apologies, unfamiliar with editor):

const nowAsString = () => { let date = new Date() let year = date.getUTCFullYear(), mth = date.getUTCMonth() + 1, day = date.getUTCDate(), hr = date.getUTCHours(), min = date.getUTCMinutes(), sec = date.getUTCSeconds() if (mth < 10) mth = '0' + mth if (day < 10) day = '0' + day if (hr < 10) hr = '0' + hr if (min< 10) min = '0' + min if (sec<10) sec='0'+sec return year + mth + day + hr + min + sec } module.exports = { nowAsString }

sriver111 avatar Mar 26 '21 19:03 sriver111

@seppevs I kindly request you to remove the date-fns dependency. It is weighing this library down a lot.

davidzwa avatar May 11 '23 19:05 davidzwa