sindresorhus / pretty-ms

Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`
MIT License
1.08k stars 65 forks source link

Remove `plur` dependency #23

Closed Rich-Harris closed 6 years ago

Rich-Harris commented 6 years ago

This module depends on plur in order to pluralise words. In turn, plur imports this long list of irregular plurals, none of which are relevant to pretty-ms since it doesn't need to know that the plural of 'goose' is 'geese'.

By replacing that import with the following line...

const plur = (word, count) => count === 1 ? word : word + 's';

...we can shrink the size of the package by about two thirds (depending on how exactly you minify and compress). For Rollup users, it also means that they don't need to use rollup-plugin-json to consume this module.

sindresorhus commented 6 years ago

Makes sense :)