EvanHahn / HumanizeDuration.js

361000 becomes "6 minutes, 1 second"
https://evanhahn.github.io/HumanizeDuration.js/
The Unlicense
1.64k stars 175 forks source link

Remove humanizers #179

Closed EvanHahn closed 3 years ago

EvanHahn commented 4 years ago

There are two ways to humanize duration with this library:

  1. Call humanizeDuration(123)
  2. Create a humanizer with humanizeDuration.humanizer, then call that humanizer

Humanizers are still a useful concept and we should document how to do it yourself, but it adds unnecessary complexity to the library for little benefit.

Removing it should be a matter of:

  1. Moving the tests out of test/humanizer.js into separate files
  2. Updating any other tests
  3. Replace humanizeDuration.humanizer with a function that errors, adding a link to documentation (to ease migration)
  4. "Following" that change to delete it successfuly