Open terlar opened 5 years ago
It is only dev dependencies : https://github.com/moment/moment/blob/develop/package.json#L39
npm install --save-prod
I'm sorry if I was unclear, I meant moment itself:
$ du -hs moment
3.5M moment
$ find moment -name '*.js' | wc -l
367
$ find moment -name '*.js' -exec cat {} \; | wc -l
56957
It is quite a substantial amount for smaller things.
I looked into this at one point. The ideal thing to do here would be to replace Moment with dayjs
, which is designed to be a lighter but API compatible drop-in replacement. Unfortunately, dayjs
doesn't yet support .duration()
- I've been following this issue, and hoping it gets merged in soon, but progress seems slow.
Or add duration and timestamp like a dependencie with addFormat.
convict.addFormat(require('convict-duration'))
Next step:
Would it be possible to drop the dependency on
moment
? I want to usenode-convict
in a smaller project, but the fact that it depends on moment which pulls in quite a substantial amount of code I have to second guess if I can use it. Perhaps some smaller date function library could replace it?I also noticed yargs, which seem to have a limited use, what is it used for today?
Thanks for a very useful package.